Description
Currently, the api wikilambdasearch_labels orders the result by minimizing the levenshtein distance, which is quick and also part of the php standard library.
This ranking could improve significantly, for example:
- It could favor those results where the matching substring occurs earlier in the string. (E.g. when searching for "And", currently the match would be the same with "Android" and with "farmland", but it would make sense to show "Android" on top)
- It could also favor those matches that occur in the user language or its fallbacks.
More details
- This is a well-delimited task and good for a beginner with no Wikifunctions experience
- Rewrite (or add similar method that returns a numerical value) ApiQueryZObjectLabels.php::getMatchRate
Desired behavior/Acceptance criteria
- Should improve ranking results
- Should not increase run times excessively
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist