Page MenuHomePhabricator

Refactor Search Handler
Closed, ResolvedPublic

Description

Refactor the actual search handler by moving it out of the code and reduce the logic within the app.vue file

This task will affect all the actions that may trigger a search (change term, change type & change category).

The most common test required are:

  • Search directly from a blank page
  • Search using the top right search box
  • Search multiple terms
  • Change types of search
  • Change categories
  • Go forward and backward multiple times
  • Scroll to bottom and trigger auto search
  • scroll to bottom and click "search more" when autosearch is fulfilled (it autosearch just twice)
Notes for QA
  • Behavior of the application should remain unchanged from the end-user's perspective

Event Timeline

SimoneThisDot renamed this task from Refactor FilterHandler to Refactor Search Handler.Sep 29 2021, 7:16 AM
SimoneThisDot updated the task description. (Show Details)

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

[mediawiki/extensions/MediaSearch@master] Refactor Search Handler

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

Change 726584 merged by jenkins-bot:

[mediawiki/extensions/MediaSearch@master] Refactor Search Handler

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

Filed as T294953: MediaSearch searches are more restrictive than Special:Search.

@SimoneThisDot, @Cparle - most likely my question is a false alarm (or not relevant to the scope of this task) , but I noticed that the MediaSearch in commons betalabs restricts searches to File namespace only.

Steps:

  1. On betalabs in a private browser window without logging in, type in the search text field a search word : rose (https://commons.wikimedia.beta.wmflabs.org/w/index.php?search=rose&title=Special:MediaSearch&type=image). Only two results will be displayed:

Screen Shot 2021-11-01 at 12.19.22 PM.png (1×2 px, 498 KB)

  1. Click on "Switch to a Special:Search" - Special:Search will display more results than Special:MediaSearch.

Screen Shot 2021-11-01 at 10.39.29 AM.png (1×2 px, 708 KB)

The difference in the numbers of fetched results cannot be explained by the fact the Special:Search by default searches in more namespaces. If on Special:Search I remove extra namespaces - Help, Category, Creator, Institution - there are still more results for jpg image files with rose in the title than on MediaSearch.

When I remove (Gallery) namespace - only then the number of search results between Special:Search and Special:MediaSearch will match.

I've checked the production and could not see such big difference in the number of fetched results between MediaSearch and Search. I save some queries results from production to monitor for possible inconsistencies between searches on MediawikiSearch and Special:Search.

Etonkovidova closed this task as Resolved.EditedNov 3 2021, 9:20 PM

Checked in wmf.7.

Etonkovidova removed SimoneThisDot as the assignee of this task.
Etonkovidova assigned this task to SimoneThisDot.