Skip to content

Wrong search results when filtering for nutriments #12175

@ygaspoz

Description

@ygaspoz

What

  • When filtering for nutriments, wrong results appear not following the defined filters.

Steps to reproduce the behavior

  1. Go to the wiki: https://wiki.openfoodfacts.org/Open_Food_Facts_Search_API_Version_2
  2. On the wiki, there is an example to get sugars_serving > 10
  3. Click on the given link: https://world.openfoodfacts.org/api/v2/search?categories_tags=en:sodas&sugars_serving%3E10g&fields=code,product_name,sugars_serving
  4. The search results show products with less than 10g of sugar per serving

Expected behavior

  • The result does not show product with more less than or equal to 10g of sugar per serving.

Why

  • As this is a very crucial functionality in searching for products

Screenshot/Mockup/Before-After

{ "count": 554, "page": 1, "page_count": 20, "page_size": 20, "products": [ { "code": "54491472", "product_name": "coca cola 500ml", "sugars_serving": 53 }, { "code": "5449000131836", "product_name": "Zero Sugar", "sugars_serving": 0 }]}

Part of

Type of device

  • Browser: Chrome
  • Postman
  • Python requests

Number of products impacted

ALL

Time per product

A lot

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    To discuss and validate

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions