Search code examples
countsetcpu-wordlimitsphinx

How can I set max word count?


how can I do sphinx search set limit for the word count. For example I have faceted search for 2100 products with 190 filters (price, color etc.) and result time is 0.004 second. Very good for me. But there's something I 've wondered.

Faceted search example

  • Blue(1700)
  • Yellow(676)
  • Green(224)

I want to this

  • Blue(999+) <- Sphinx count max 1000, not much more. How can i this? Is this possible?
  • Yellow(676)
  • Green(224)

improves performance?

Thank you.


Solution

  • There is no setting for this.

    And even is was doubt it wold inprove performance. When doing the counting loop, would have to add a conditional, to check if above a threshold and if so do nothing, otherwise increment the counter. its less work to just to increment anyway.

    Max_matches affects the number of groups more, rather than the count within.

    Can do it in application code for display purposes if like.