Using Typesense to Search Specific Document IDs
TLDR Tshepo inquired about performing specific document ID searches in Typesense. Jason advised using the
filter_by=id:=[1,2,3,etc] function or directly querying Typesense.
Apr 17, 2021 (34 months ago)
I recently started playing with typesense, trying to figure out how it can fit into my system. I have to say its some great work the typesense team and community are doing.
I don't know if typesense can work for my needs but here is what i need or how my system works:
1. Get a list of ids from another database that corresponds to document ids in typesense.
2. Do a search in typesense but only search documents that are returned in the list of ids.
Is this sort of functionality possible?
filter_by=id:=[1,2,3,etc]to your search query to only search within a subset of documents
Indexed 3015 threads (79% resolved)
Querying Documents by ID in Typesense
Facundo asked how to query documents by ID, and Jason suggested creating a new field named `id_search` for this purpose.
Excluding Specific Documents in Typesense Results
Alexander asked how to exclude specific documents in Typesense search results, and Jason suggested using the hidden_hits search parameter and multi_search for large lists.
Retrieving Multiple Documents by ID in Typesense
Bruno asked about retrieving multiple documents by ID in Typesense. Jason suggested using `filter_by: id:=` and gave advice on POST requests and order preservation. Bruno successfully implemented these solutions.