dataiku / dataiku-contrib

Public repository for DSS plugins
Apache License 2.0
100 stars 82 forks source link

Algolia: using index.browse() instead of index.search()? #61

Open jereze opened 6 years ago

jereze commented 6 years ago

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.

cstenac commented 6 years ago

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