Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store number of unique scans by country for the last year in the product object #11334

Open
stephanegigandet opened this issue Feb 6, 2025 · 0 comments
Labels
scan statistics Scan statistics allow us to concentrate efforts on impactful products, and add countries where sold Scanbot

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Feb 6, 2025

We currently have one popularity sort key that is the same for the whole world. So the order of products by popularity is the same in all countries (but some are filtered if they are not sold in the country).

We currently store scans statistics in a JSON file next to the product .sto files:

In order to be able to show popular products by country, we could store the raw number of scans for each country in the last year directly in the product object.

e.g. unique_scans : { world : 1000, fr : 750, be: 200, nl: ... } etc.

We could also remove the popularity key (which is a bit complex as it uses unique scans, top scans, and date of last image), if we can find a way to get sorted products by unique_scans in a country (primary key) and by another field like last_modified_t (secondary key) so that we have a unique ordering of products (in order to have products by page).

This unique_scans by country could be saved in off-query, so that we can sort on it to retrieve lists of products.

@github-project-automation github-project-automation bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Feb 6, 2025
@teolemon teolemon added scan statistics Scan statistics allow us to concentrate efforts on impactful products, and add countries where sold Scanbot labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scan statistics Scan statistics allow us to concentrate efforts on impactful products, and add countries where sold Scanbot
Projects
Status: To discuss and validate
Development

No branches or pull requests

2 participants