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?
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With