John
06/29/2022, 12:15 PMmax_candidates
affects it and I don’t understand how so I’d like to get some clarification on what it does. In the documentation it says
Control the number of words that Typesense considers for typo and prefix searching.and I interpret that to refer to words in the search query, but then what I’m seeing doesn’t make sense so maybe I misunderstood it! Posting an example of what I mean in comments
John
06/29/2022, 12:16 PM{
"title": "foobar",
"description": "baz"
}
in my collection, and I try to search for fooba baz
. With default max_candidates=4
I get no results, with max_candidates=1000
I get correct results. In my mind this parameter shouldn’t have any effect, but I must be misunderstanding something.Kishore Nallan
06/29/2022, 12:20 PMJohn
06/29/2022, 12:23 PM0.23.0
and 0.24.0.rc12
Kishore Nallan
06/29/2022, 12:31 PMJohn
06/29/2022, 12:43 PMKishore Nallan
06/29/2022, 12:44 PMJohn
06/29/2022, 1:56 PM#{}|
• It only seems to happen when one of the query characters is a special character
• It only happens with drop_tokens_threshold=0
Kishore Nallan
06/29/2022, 3:07 PMKishore Nallan
07/04/2022, 1:56 PMfoobar o}
the document that's matching is {'description': 'o}', 'title': 'foobars'}
When you have 2 tokens and each token can have variations of prefix/typo combination, the actual possible number of queries will be a combination each token's variations. Max candidates parameter also governs the number of combinations checked in multi word queries. So increasing max_candidates helps in not restricting the query earlier.