openfoodfacts / search-a-licious

🍊🔎 A pluggable search service for large collections of objects (like Open Food Facts)
https://search.openfoodfacts.org
GNU Affero General Public License v3.0
7 stars 5 forks source link

Switch to mongoDB schema #6

Closed simonj2 closed 2 years ago

simonj2 commented 2 years ago

Switched to using the MongoDB schema, rather than the flatter schema from the CSV file.

The new index (with all the data from MongoDB) is 50GB (100GB with two nodes and needs ~4GB of RAM for the import and the import takes ~an hour :( However, having the complete data means this can be a drop in replacement for the old APIs. Furthermore, the search is still reasonably fast - ~0.5 seconds for some large queries.

As usual - will merge this tomorrow unless there's feedback.