Page MenuHomePhabricator

AdvancedSearch should end the current request when redirecting the namespaced search URL
Closed, ResolvedPublic

Description

As a maintainer of CirrusSearch I would like to only send search requests to elastic the ones whose results are actually displayed to the user so that backend logs are more meaningful and the cluster resources are used more efficiently.

The extension uses the SpecialPageBeforeExecute hook to redirect from /index.php?search=~search+query&title=Special:Search&go=Go to /index.php?search=~search+query&title=Special:Search&go=Go&ns0=1 (to add the ns0=1 param).

The SpecialPageBeforeExecute hook should return false in this case to abort execution of the SpecialSearch page otherwise the search query is being processed twice by the backend but only displayed once.

AC:

  • when entering Special:Search from the autocomplete search box the search request (nearmatch + fulltext) is only performed once before I see the search results.

Event Timeline

dcausse created this task.Oct 13 2020, 4:21 PM

Change 633778 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/AdvancedSearch@master] Abort execution of the Special:Search page when redirecting

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

dcausse updated the task description. (Show Details)Oct 13 2020, 4:29 PM

Change 633778 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] Abort execution of the Special:Search page when redirecting

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

Gehel closed this task as Resolved.Oct 26 2020, 1:44 PM