#community-help

Issues with DropTokensThreshold in InstantSearch.js

TLDR John had issues with dropTokensThreshold in InstantSearch.js. Jason clarified it only affects searches with less than 10 results.

Powered by Struct AI
6
15mo
Solved
Join the chat
Jun 02, 2022 (15 months ago)
John
Photo of md5-7a0ab48aa8979a59e1d8c3919797c1f8
John
05:45 PM
Is it possible to use the dropTokensThreshold with InstantSearch.js?

I tried
  additionalSearchParameters: {
    queryBy: 'queryby1,queryby2', //categories,
    sortBy: '_text_match:desc,numsales:desc',
    dropTokensThreshold: 10
  },

But seems like it was not taken into account...
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:47 PM
That's the way to set it.
05:47
Jason
05:47 PM
Could you check the network request to confirm that it was sent to Typesense
John
Photo of md5-7a0ab48aa8979a59e1d8c3919797c1f8
John
09:35 PM
Seems like it is. I think it was actually taken into account, except it did not change anything in the results for the search I made...
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:36 PM
It will only kick in when the number of results is less than 10 (the value you've set)
09:36
Jason
09:36 PM
So if the number of results is > 10, then tokens won't be dropped