Open teolemon opened 4 years ago
Same problem as issue #180 The results of autosuggest are translated fields whereas we need translation keys for robotoff
For example, the autosuggest returns Organic
whereas we need en:organic
. This means we have to guess the language
Seems that by adding parameter lc=en
or lc=fr
, ... we can choose the language in which labels/categories are sent
https://world.openfoodfacts.org/cgi/suggest.pl?tagtype=labels&term=organ&lc=en => returns organic https://world.openfoodfacts.org/cgi/suggest.pl?tagtype=labels&term=organ&lc=fr => returns empty list
A solution to get keys would be to have a look at the taxonomy used by robotoff: https://github.com/openfoodfacts/robotoff/tree/master/data/taxonomies
See if it worths importing all the tags
Hi @teolemon this issue interests me.
I want to do the required changes. I would need details like which file to start with, and a little more information. Thanks.
Add autosuggest in the category and label games
Rationale: it's often difficult to guess the exact name to filter with, and if just one S is missing, or CAPSLOCK is enabled, there is no match.
Proposed solution Use the Open Food Facts autosuggest APIs and JQUERY to let the user find categories. The API is multilingual by default, so nothing more to do. https://world.openfoodfacts.org/cgi/suggest.pl?tagtype=categories&term=ca https://world.openfoodfacts.org/cgi/suggest.pl?tagtype=labels&term=ca