Implementing OR Query in Typesense for Multiple-Word Search
TLDR Md.Riad was seeking assistance on implementing an OR query in Typesense for multiple word search. Jason clarified that Typesense already provides this feature by default and suggested to adjust the
drop_tokens_threshold to obtain more varied results.
Sep 03, 2023 (3 months ago)
I want to search by multiple word or words. Means I want OR query by a single search of a collection (where operation like feildName ="value" or feildName = "value2")
my search keyword is ''plastic bottle"
q :- documentFeild = "plastic" or documentFeild = "bottle" query_by :- documentFeild
Expected result (documents) :-
Where enough is controlled by the value of
So if you increase
drop_tokens_threshold: 10000then you should see more results with different keywords dropped.
Sep 04, 2023 (3 months ago)
Indexed 3015 threads (79% resolved)
Resolving Typesense Search Issues
Conversation started by Maximilian about Typesense search behavior led to Users Kishore Nallan and Mike discussing and suggesting workaround, with Kishore Nallan promising an official solution soon. No final confirmation of resolution provided.
Using Typesense to Retrieve Multiple Keyword Matches
Ravi expressed confusion over Typesense not returning all results for multi-keyword queries. Kishore Nallan explained that Typesense does `AND` of all keywords and drops tokens from right to left until records are found if no exact match exists. Kishore Nallan clarified that disabling the drop_tokens_threshold could alter this behavior.
Achieving Desired Query Results in Typesense
Timothy asked how to include documents containing any query term in Typesense. Jason explained that by adjusting the `drop_tokens_threshold`, this behaviour can be achieved.