Page MenuHomePhabricator

[minor-wmf.14] MediaSearch - "sdms-did-you-mean" displays ' haswbstatement'
Closed, ResolvedPublic

Description

  1. On Special:MediaSearch enter search terms that would display "Did you mean", e.g. "pika" (https://commons.wikimedia.org/w/index.php?title=Special:MediaSearch&go=Go&type=image&search=pika)
  2. When Did you mean: pike will be displayed, click on one of the Community assessments filter - e.g. https://commons.wikimedia.org/w/index.php?title=Special:MediaSearch&go=Go&type=image&search=pika&assessment=valued-image

Did you mean: haswbstatement:P6731=Q63348040 pike will be displayed.

Screen Shot 2021-07-14 at 5.36.42 PM.png (1×1 px, 503 KB)

Note: Sometime "Did you mean" suggests modifications to the search terms that look unreasonable, e.g. searching for "dark roses" returns 6,602 results, yet "Did you mean dark robes" suggestion will be displayed that returns only 685 results.

Event Timeline

Etonkovidova renamed this task from [minor-wmf.14] "sdms-did-you-mean" displays html when MediaSearch page is refreshed to [minor-wmf.14] MediaSearch - "sdms-did-you-mean" display issues.Jul 15 2021, 12:45 AM
Etonkovidova updated the task description. (Show Details)
Etonkovidova renamed this task from [minor-wmf.14] MediaSearch - "sdms-did-you-mean" display issues to [minor-wmf.14] MediaSearch - "sdms-did-you-mean" displays ' haswbstatement'.Jul 19 2021, 4:40 PM
Etonkovidova updated the task description. (Show Details)

I have investigated the task and found the issue being due to the haswbstatement not being filtered out on the Vue side.

There is a method the actions.js file called "extractSuggestedTerm". This method is failing to remove the extra filter fro the string, as the "filters" variable does not include the haswbstatement.

The proposed fix would be toL

  • enhance the extractSuggerstedTerm to also take care of filterValues.assessments

Change 706313 had a related patch set uploaded (by Simone Cuomo; author: Simone Cuomo):

[mediawiki/extensions/MediaSearch@master] MediaSearch - \"sdms-did-you-mean\" displays ' haswbstatement'

https://gerrit.wikimedia.org/r/706313

The following work has been completed

  • enhance the extractSuggerstedTerm in vue actions to work with filterValues.assessments
  • Enhance the extractSuggestedTerm in the PHP side to work with assessments

Tested scenarios:

  • Normal search with suggestion
  • PHP rendered search with "assessments"
  • VUE rendered search with "assessments"

bug: T286688
Change-Id: I3326f46d14183cddd61baf472236f8436c67bbf2

Change 706313 merged by jenkins-bot:

[mediawiki/extensions/MediaSearch@master] MediaSearch - \"sdms-did-you-mean\" displays ' haswbstatement'

https://gerrit.wikimedia.org/r/706313