Page MenuHomePhabricator

Improve Special:MediaSearch autocomplete suggestions for multiple terms
Closed, ResolvedPublic


The autocomplete suggestions are currently based on wikidata terms (labels or alias) where the beginning matches the search string.
This prevents getting suggestions when searching for multiple terms.
E.g. you might be looking for "flag russia" (and would expect the latter word to get autocomplete suggestions), but because there is no item with "flag russia" label or alias, it doesn't autocomplete.

Including a similar search for entities based on only the last word and including those in the autocomplete results, would probably be a good improvement, even though it might result into suggestion combinations that don't make a lot of sense (but then again, this also happens with Google autocomplete)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 25 2020, 8:21 AM

Change 598494 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] Also fetch autocomplete suggestions for last word

TJones added a subscriber: TJones.May 26 2020, 9:12 PM

There are the same segementation problems for some languages using spaces as I mentioned in T252891.

Maybe both cases could be improved by having a limit on how many characters you consider, rather than words, but I'd have to think about it a lot more.

In general, though, if you are going to go this way, I'd recommend using multiple tokens for suggestions—which Google obviously does. It's more expensive, but looking back two or three words can give better suggestions. For example, given health, Google suggests "healthy snacks". But given world health, Google suggests "world health organization", which is obviously better than "world healthy snacks".

Change 598494 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Also fetch autocomplete suggestions for last word

Ramsey-WMF closed this task as Resolved.Jun 15 2020, 4:52 PM
Ramsey-WMF added a subscriber: Ramsey-WMF.

Certainly works better now, we'll continue to refine for more improvements as we go.