#community-help

Retrieving Over 250 Documents from Typesense Collections

TLDR Saurabh wanted to fetch more than 250 docs from Typesense. Jason explained they can use the page parameter and the export endpoint, and advised on how to parse the JSONL response.

Powered by Struct AI
May 26, 2023 (6 months ago)
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
03:22 PM
Hi Team !!
Can we get more than 250 docs from Typesense!!!!? We are searching from 2 different collections simultaneously...
for eg: we have collection A and collection B, 1st we search in Collection A and we use theirs ids to search in collection B , where B have foreign key from collection A
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:36 PM
You can indeed get more than 250 docs from Typesense. The 250 limit is for a single page - the per_page parameter specifically.

You can use the page parameter to fetch additional pages and documents
May 28, 2023 (6 months ago)
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
01:10 PM
will it be possible to get 1000 docs on a single page, if I remove per_page , so am only getting 10 docs per page....can you pls guide be how can I get all docs for filters ?
01:11
Saurabh
01:11 PM
BTW Thanks for the help Jason..
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:11 PM
Default for per page is 10, and max is 250 for performance reasons
01:12
Jason
01:12 PM
If you just want to use filter_by to get all docs, you can use the export endpoint
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
01:14 PM
where can i get export endpoint ?
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
01:39 PM
is there any way to specify type of response in export document , as we are getting str as a response ... can we get it in dict format or I need to convert to dict ?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:12 PM
It’s in JSONL format for performance. So you would have to split by new line and do a json parse on each line

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community