I had an interesting discussion lately. Let's say ...
# community-help
a
I had an interesting discussion lately. Let's say the following scenario: • A user uses a few filters and search for some documents. • The user is allowed to i.e. "ignore" documents in the results to not see those again. How would I tell Typesense to not include these results - depending on the user searching? A few options I researched: • Long queries: Simply use a filter, but use very long queries if many results are excluded • Overrides: Have a list of excluded documents per user which will still be a long query, just at a different time as I have not found a way to "add conditions" instead of creating full lists How would you guys implement this, especially for large amounts of excludes? 🙂
j
There’s a search parameter called hidden_hits that you can use to exclude specific document IDs for a search query.
That would be the most appropriate for this use case. You could use multi_search to allow for a large list of document IDs
a
Thank you for your answer! How large can such a query become? Could I hide say 1000 IDs? is that even a good idea? I wanted to do this on Typesense's end to be able to still use pagination.
j
Yeah 1000 IDs should be fine
Typesense will take care of pagination as well