#community-help

Troubleshooting Filter Differences in Search Results

TLDR Luke experienced problems with filter discrepancies in search results. They attempted Kishore Nallan's suggestion of adjusting thresholds, but issues persisted. Further investigation is required.

Powered by Struct AI
Aug 01, 2021 (25 months ago)
Luke
Photo of md5-124f493c74e026a709acf7f55fa2ca47
Luke
12:52 PM
I'm having trouble with filtering. I am using the same search throughout but when I filter by "sold: true" I get 20 results, when I filter by "sold:false" i get 67 results. But when I search with no filter it returns 56 results
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:54 PM
I think this might just be the fuzzy query relaxation kicking in. Can you try setting drop_tokens_threshold: 1 and typo_tokens_threshold: 1 when making the queries? Basically Typesense expands the search universe to fetch more items when enough results are not found. This can also happen during prefix searches on very small prefixes like single char/two char tokens.
Luke
Photo of md5-124f493c74e026a709acf7f55fa2ca47
Luke
12:54 PM
okay thank you
12:57
Luke
12:57 PM
added those fields, it now returns 4 for false and 8 for true
01:53
Luke
01:53 PM
Kishore Nallan any idea why this is?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:54 PM
Would need more details. If you can create a small reproduceable sample dataset, please share that with me + query so I can investigate.