openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
653 stars 381 forks source link

Search: inconsistency with `count`, `page_count` and the number of products. #9278

Open monsieurtanuki opened 11 months ago

monsieurtanuki commented 11 months ago

What

Steps to reproduce the behavior

https://world.openfoodfacts.org/cgi/search.pl?lc=en&tags_lc=en&fields=code&tagtype_0=creator&tag_contains_0=contains&tag_0=monsieurtanuki&page_size=1000&search_terms=&json=1&api_version=3

{
    "count": 6,
    "page": 1,
    "page_count": 5,
    "page_size": 1000,
    "products": [
        {
            "code": "8032597603380"
        },
        {
            "code": "07790386"
        },
        {
            "code": "1407178902"
        },
        {
            "code": "9786756453"
        },
        {
            "code": "1407178901"
        }
    ],
    "skip": 0
}

Expected behavior

stephanegigandet commented 11 months ago

It may be a caching issue, I get a count of 6 with caching, and 5 without caching. We currently have different caches for the counts and for the results.