Improving Recommendations Query Using 'drop_tokens_threshold'
TLDR Maciej queried about using 'drop_tokens_threshold' in a recommendations query, hoping to receive documents of different categories. Kishore Nallan clarifies how the query works, but understanding was not confirmed.
Jan 29, 2023 (10 months ago)
Maciej
02:09 PMI'm trying to make simple "recommendations" query. I would like to fetch documents based on user's preferences and fill with other ones if not enough matches. So far I've tried something like this:
q=volleyball&query_by=categories&filter_by=env:dev&page=1&per_page=50&drop_tokens_threshold=50&prefix=false
but I'm not even getting documents not having volleyball in categories field. This is how categories
property is defined: {"name": "categories", "type": "string[]", "facet": *true* }
. Can you advise something?PS. Typesense is great, I love the geosearch feature!
Jan 30, 2023 (10 months ago)
Kishore Nallan
04:03 AMMaciej
07:16 PMvolleyball
in categories in collection. Question actually relates to drop_tokens_threshold
parameter. My understanding of docs is that in I case I set it to 50 like in this example, volleball
should be dropped and I should receive documents having other categories as well. Is my understanding wrong?Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Issue with Search Term Results in Typesense
Dipankar had issues with specific search terms returning unexpected results. Kishore Nallan clarified why this may occur and how to fine-tune the behavior using the 'drop_tokens_threshold' parameter in Typesense.
Methods for Fetching, Querying, and Modifying Collections in Typesense
Bill inquired about performing OR queries, querying empty arrays and modifying collections in Typesense. Kishore Nallan explained the current limitations and provided workarounds and recommendations for each case. The conversation also touched upon the usage of cache in Typesense and the workings of the _eval function.
Trouble with Document Matching in 'filter_by' Field
Roman struggled with incorrect matches in the `filter_by` field. Kishore Nallan explains it only works at the word level, not partial prefix, and suggested setting `drop_tokens_threshold` to 0 to prevent incorrect matches.