dataiku-contrib
dataiku-contrib copied to clipboard
Algolia: using index.browse() instead of index.search()?
https://github.com/dataiku/dataiku-contrib/blob/089108002649d92f81719ddd576f925874026d92/algoliasearch/python-connectors/algoliasearch/connector.py#L78
From Algolia documentation, index.browse() is recommended to retrieve a full index.
If you need to retrieve all the content of your index (for backup, SEO purposes or for running a script on it), we recommend leveraging browse as opposed to querying, as this method is optimized for speed.
Also, index.search() does not return the full index.
Algolia limits the maximum number of hits that can be retrieved via a query to 1000.
Actually on this line, we want to retrieve 0 hits, we only want the facet for partitioning.
We could use index.browse() for the main get_hits function but only if no search query is defined