#community-help

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.

Powered by Struct AI
Jan 29, 2023 (10 months ago)
Maciej
Photo of md5-12131237489cf2e07cd909273ee2adbd
Maciej
02:09 PM
Hi All,
I'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
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:03 AM
This query should return documents contain the word volleyball in the categories field provided those documents also satisfy the filter condition. Are you saying that the docs returned don't bave the word volleyball? Or no docs are returned?
Maciej
Photo of md5-12131237489cf2e07cd909273ee2adbd
Maciej
07:16 PM
Well, actually I don't have any documents having volleyball 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?