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
Barcode json search url does not always work #2435
Comments
In fact this is working as intended, so that we don't have a huge amount of different entries in the /codes facet. We had the x, xx and xxx entries before, but it rendered the facet unusable, so they were removed.
|
Is confusing if someone does a search and nothing happens any more. |
It's not a search though. If you have the barcode, then you can use the API to get the product directly, without using the codes facet. The facet is intended to group products from the same brand, it's not for search. |
The app uses it to drill down the list of results, with each addition of a digit. So it is a search there. |
I wasn't aware that the app used the facet to do that, it's an interesting use. I'm not sure if that use case is worth the extra load in the database and server though. Those queries are relatively stressfull for the server, and making one for each digit typed is a lot. Using an offline db of codes may be better. |
Stale issue message |
Describe the bug
Finetuning the barcode search url to get only one products breaks down at some stage.
To Reproduce
Try:
https://ssl-api.openfoodfacts.org/code/87176773367xx.json
results in 1 product.https://ssl-api.openfoodfacts.org/code/871767733672x.json
results in 0 products. (is valid)Expected behavior
Should stay 1 product
The text was updated successfully, but these errors were encountered: