Open PierreAnctil opened 6 years ago
I fixed part of this - the search is now done in the current language.
Ok great, what is still have do be done ? Did you push in staging and/or production ?
The following still needs to be done, but I understood it has less priority?
The autocomplete should favor exact matches and then "starts with" matches and at last the "contains" results.
I pushed it to staging and will push it to production tomorrow.
As discussed with Adam Skype, this is important for us. This will prevent the addition of existing lines in the catalog when adding an item in the requeste item.
@WorldSkillsFrance Can you provide an example where you see the problem happening?
Could be because there's a limit on the results or because it has the wrong language (locale) key in the database.
I noticed the values for "Table" in the database have the language key fr_FR
. I assume this happened before we adjusted Accept-Language
in https://github.com/worldskills/worldskills-infrastructure-list/pull/37.
I have now manually fixed the Table:
UPDATE i18n_value SET lang_code = 'fr' WHERE lang_code = 'fr_FR';
However this doesn't seem to be the issue, as the table is still not found.
Unfortunately there is a limit of 25 items on the search and just removing it would cause performance issues.
Searching for matches which have the search query at the beginning also wouldn't be a good solution as that would make it less likely for someone to find an existing matching item, if they start the name with something else.
Searching for matches at the beginning first and then for matches in the middle of the work also doesn't solve the problem in the case there are more than 25 items with the query in the beginning.
A good solution would be to add a proper search with Lucene but that would require quite some development.
A quick solution might be to increase the limit to 100 items for now.
I think we should go for 100. What do you think @WorldSkillsFrance?
Okay, limit increased to 100.
Thx Fabian, this is good for the moment. The best would be :
Today when one is creating a requested item and types "table" in the description, many items are suggested but not "Table" even though the item is in the catalog.
The reason is there are many results and their number is limited.
The autocomplete should favor exact matches and then "starts with" matches and at last the "contains" results.
Furthermore the search should only be done on the current language.
@worldskills/geeks @WorldSkillsFrance