Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Algolia Search api returns maximum 1000 records while my total records are around 50000

Tags:

My index in Algolia contains around 50k records. While using javascript api for retrieving records it only returns maximum 1000 records, i am using search() function. Any suggestions?

like image 560
Muzammil Naseer Avatar asked May 20 '16 12:05

Muzammil Naseer


2 Answers

search() function by default returns only 1000 records. If in case you need to retrieve more than 1000 records you should use browse() function instead. However search function is more optimised then browse function. Always prefer search() over browse unless you really want to retrieve all your records(for backup purpose).

Reference to API doc: Browse All Index Content

like image 160
Sohaib Farooqi Avatar answered Oct 14 '22 20:10

Sohaib Farooqi


The search() function is, indeed, only able to retrieve you 1000 results at max. Most of the time, you don't need to retrieve so many results because you probably just want to display a few of them.

However, if you really need to access all your records, for backup or anything else, you should use the browse() function which does exactly that. :)

More informations here on this FAQ page

like image 41
aseure Avatar answered Oct 14 '22 18:10

aseure