Is it possible to search by different words? I hav...
# community-help
r
Is it possible to search by different words? I have brand collection with names “dettol” and “moove”. If i search for “dettol” or “moov”, i am getting proper results. But when I search for both brands togather “dettol moove”, only “dettol” is being returned. Is it possible to get both the brands in results here?
k
If Typesense does not find records with all tokens in the query it will drop tokens from the query right to left and then left to right until records are found.
If you are talking about filtering, see the example Anton posted after this message on the channel to do a OR filter.
r
Slight misunderstanding i think. I have collection of products {name: “Soap”, brand: “dettol”}, {name: “Shampoo”, brand: “clinc plus”}. In this case if i search with “dettol clinic”, will it return both products?
k
No, Typesense does
AND
of all keywords in the query. If it cannot find any document containing all words in the query, like in this case, instead of doing a OR, it drops tokens from the query one by one until results are found.
r
Okay
r
Any way to disable that dropping behavior? To only return results if all keywords were found?
k
Yes set drop_tokens_threshold to zero.
👍 1