#community-help

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

Apr 17, 2021 (34 months ago)
Tshepo
Photo of md5-53640648a904ae2baae1334dcc6a28e3
Tshepo
07:07 PM
Hi 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?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:17 PM
Thanks Tshepo!
07:18
Jason
07:18 PM
You could add a filter_by=id:=[1,2,3,etc] to your search query to only search within a subset of documents
07:19
Jason
07:19 PM
Another 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
Photo of md5-53640648a904ae2baae1334dcc6a28e3
Tshepo
07:44 PM
Thanks a lot Jason let me get to testing this out.

1