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.
Powered by Struct AI
1
5
34mo
Apr 17, 2021 (34 months ago)
Tshepo
Tshepo
07:07 PMHi everyone,
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?
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?
Jason
Jason
07:17 PMThanks Tshepo!
07:18
Jason
07:18 PMYou could add a
filter_by=id:=[1,2,3,etc]
to your search query to only search within a subset of documents07:19
Jason
07:19 PMAnother thing you could do is, add whatever fields you're querying by in your other database to Typesense and then use those fields to query Typesense directly, instead of having to do lookups in two systems.
Tshepo
Tshepo
07:44 PMThanks a lot Jason let me get to testing this out.
1
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 3015 threads (79% resolved)
Similar Threads
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.
3
6mo
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.
6
8mo
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.
18
5mo