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

Duplicate food records with/without product type #11069

Open
monsieurtanuki opened this issue Nov 29, 2024 · 3 comments
Open

Duplicate food records with/without product type #11069

monsieurtanuki opened this issue Nov 29, 2024 · 3 comments
Assignees
Labels
🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers

Comments

@monsieurtanuki
Copy link
Contributor

What

There are apparently duplicates in the food database, with and without product type.

Steps to reproduce the behavior

https://world.openfoodfacts.org/cgi/search.pl?lc=fr&tags_lc=fr&cc=fr&fields=code,product_name,product_type&code=8722700202387&search_terms=&json=1&api_version=3

{
    "count": 2,
    "page": 1,
    "page_count": 2,
    "page_size": 50,
    "products": [
        {
            "code": "8722700202387",
            "product_name": "Amora Moutarde Douce Flacon Souple 260g",
            "product_type": "food"
        },
        {
            "code": "8722700202387",
            "product_name": "Amora Moutarde Douce 260g"
        }
    ],
    "skip": 0
}

Expected behavior

No duplicates

@github-project-automation github-project-automation bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Nov 29, 2024
monsieurtanuki added a commit to monsieurtanuki/openfoodfacts-dart that referenced this issue Nov 29, 2024
@teolemon
Copy link
Member

@stephanegigandet

@stephanegigandet
Copy link
Contributor

This is due to a bug we had on the pro platform, that saved products on the public platform. I still have some cleanup to do.
#11064

The _id is different:
https://world.openfoodfacts.org/cgi/search.pl?lc=fr&tags_lc=fr&cc=fr&fields=_id,id,code,product_name,product_type&code=8722700202387&search_terms=&json=1&api_version=3

@stephanegigandet stephanegigandet self-assigned this Nov 29, 2024
@stephanegigandet
Copy link
Contributor

stephanegigandet commented Nov 29, 2024

off> db.products.count({"$expr": { "$ne": ["$_id", "$id"]}, "data_sources_tags": "producers"})
6738

monsieurtanuki added a commit to openfoodfacts/openfoodfacts-dart that referenced this issue Nov 29, 2024
#1004)

* feat: 995 - support of the new "product type" filter for "get product"

New file:
* `product_type_filter.dart`: Filter on product type for API get product queries.

Impacted files
* `api_not_food_get_product_test.dart`: now testing only in v3 with all product type filters
* `old_product_result.dart`: deprecated class `OldProductResult`
* `open_food_api_client.dart`: deprecated method `getOldProduct`
* `openfoodfacts.dart`: export new file `product_type_filter.dart`
* `product_query_configurations.dart`: "product_type_filter" as new optional "get product" parameter; minor refactoring

* minor fix

cf. openfoodfacts/openfoodfacts-server#11069
@teolemon teolemon added the 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers
Projects
Status: To discuss and validate
Status: Triage needed
Development

No branches or pull requests

3 participants