Page MenuHomePhabricator

On redirect, parts of the search query are not filled into the main search bar
Closed, ResolvedPublic3 Estimated Story Points


AdvancedSearch does not automatically fill in the form, but allows users to search with the main bar, as well as with the form.
When a user is redirected to the search page, and some keywords are already in use, these should be added to the main search bar.

I am on a page with an integrated search field. This search field automatically sets "prefix=Wikipedia%3ABibliotheksrecherche%2FAnfragen%2F" in the url. Once the special:search page is reached, this is removed. That means if I change the page or search again, the constraint is gone.

Sample queries
How the query used to look like:

How it looks like with advancedSearch enabled:

This bug was reported on the help talk page

Acceptance Criteria

  • When a user is redirected to special:Search, all of the given search parameters can be found in the "traditional" search box

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Lea_WMDE triaged this task as Medium priority.Feb 28 2018, 1:49 PM
Lea_WMDE set the point value for this task to 3.


  • the linked sample relies on a "prefix" parameter used in Extension:InputBox (the German documentation is better structured than the English), fulltext and search types.
  • they use a dedicated, undocumented(?) "prefix" parameter for Special:Search, i.e. not part of the "search" GET parameter but a separate one. All(?) GET parameters with influence on search result:
    • search (&search=) Example known
    • namespaces (&ns12=1&ns13=1) Example known (but broken) = T182254
    • prefix (&prefix=) Example new to me
    • searchfilter (&searchfilter=...) Example new to me
  • an attempt to remove the prefix parameter in the past was reverted
  • mediawiki's frontend code itself seem to be unaware of the "prefix" parameter, mw.config.get('searchTerm') does not contain it - no wonder we missed it
  • the "searchfilter" parameter gets appended to the "search" parameter, i.e. mw.config.get('searchTerm') == "fish chips"
  • identical results can be achieved searching for either
    • /wiki/Spezial:Suche?search=besondere+beilage&prefix=Wikipedia%3ABibliotheksrecherche or
    • /wiki/Spezial:Suche?search=besondere+beilage+prefix:Wikipedia%3ABibliotheksrecherche (mind the plus after "beilage")

Q (to @Lea_WMDE):

  • does advancedSearch have to be compatible with the dedicated "prefix" GET parameter?
  • does advancedSearch have to be compatible with the dedicated "searchfilter" GET parameter?

Worst case link makes for search field input endless joy prefix:Wikipedia:Bibliotheksrecherche.

Steps to resolve this could be (in descending likelihood)

/cc @gabriel-wmde @Tonina_Zhelyazkova_WMDE @thiemowmde

Pablo-WMDE removed Pablo-WMDE as the assignee of this task.
Pablo-WMDE moved this task from Doing to Todo on the WMDE-Fundraising-Sprint-18 board.
Pablo-WMDE added a subscriber: Pablo-WMDE.
Pablo-WMDE added a subscriber: Pablo-WMDE.

Storytime discussion resulted in the decision to use the actual general search field, instead of replacing it (unless the code gives us a reason to reconsider)

Change 418951 had a related patch set uploaded (by Gabriel Birke; owner: Gabriel Birke):
[mediawiki/extensions/AdvancedSearch@master] Leave original search field in place

gabriel-wmde moved this task from Doing to Review on the wmde-fundraising-sprint-19 board.

Change 418951 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] Leave original search field in place