-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Autocomplete suggestions limited to 25: not enough! #465
Autocomplete suggestions limited to 25: not enough! #465
Comments
We should then probably move this issue to the server repo |
@alexgarel will look into it, we could add an option to set the number of desired results. Also we could split the input query so that "boisson soja" matches any category with the 2 words "boisson" and "soja". |
@stephanegigandet Both ideas would be appreciated. The next level would be to return a json object instead of just a list, with more detailed fields like the total number of matching items (e.g. |
I started looking at it. The problem is that our suggestion is iterating the list, always in the order of the keys which might not be relevant at all ! (we might first get term that does not start with the term, etc.) As our search is not indexed and only use brute force iteration, it does not seems like a good idea to process whole list every time… |
I pushed a PR, but it's just a quick fix… I think in the future a search index could do a far better job. |
Thank you @alexgarel for that quick fix! |
@alexgarel We still have to code it in dart! |
…estions Impacted files: * `api_get_automcompleted_suggestions.dart`: additional test about the new `limit` parameter. * `openfoodfacts.dart`: new `limit` parameter for autocomplete suggestions.
Impacted file: * `api_saveProduct_test.dart`
Impacted files: * `api_get_automcompleted_suggestions.dart`: additional test about the new `limit` parameter. * `api_saveProduct_test.dart`: unrelated test skip * `KnowlegdePanelElement.dart`: `title` is now optional * `KnowlegdePanelElement.g.dart`: generated * `openfoodfacts.dart`: new `limit` parameter for autocomplete suggestions.
Describe the bug
getAutocompletedSuggestions
takes a taxonomy type and an input arguments (and a language).To Reproduce
Steps to reproduce the behavior:
soja
" in French - go to https://world.openfoodfacts.org/cgi/suggest.pl?tagtype=categories&term=soja&lc=frBoissons végétales de soja
"Boissons végétales de soja
" in French - go to https://world.openfoodfacts.org/cgi/suggest.pl?tagtype=categories&term=Boissons%20végétales%20de%20soja&lc=frBoissons végétales de soja
"Expected behavior
Boissons végétales de soja
" to be returned with the mere "soja
" search.Boissons végétales de soja
", "Boissons à base de soja
" or "Boissons végétales au soja
"Additional context
The problem obviously comes from the server, where
$limit = 25
forces the max result length.The text was updated successfully, but these errors were encountered: