#random

Altering Search Behavior in Book Search Demo

TLDR Roshan sought advice on altering an OR search to an AND search. Kishore Nallan suggested using 'drop_tokens_threshold=0' while querying.

Powered by Struct AI

1

Feb 10, 2022 (23 months ago)
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:43 AM
Hello guys, I have one question about AND search.
looking at the book search demo I found the search is OR instead of AND, for example if i want to search for a book from author "Harry August", I don't want to results where the date of publication has "August" in it. I don't want to results where one field has "Harry" and another field has "August" Kishore Kishore Nallan
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:53 AM
Use 'drop_tokens_threshold=0' to disable this behavior. By default if there are no fields which contain exact value, Typesense will look to drop tokens in the query to find results.
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:55 AM
how to use this ? while creating index or while querying?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:55 AM
While querying.
Roshan
Photo of md5-34813b759bbed85074c3a458c4a2a053
Roshan
10:57 AM
I will check

1

10:57
Roshan
10:57 AM
ok thanks