Last modified: 2013-12-13 19:48:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32229, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30229 - Allow extensions to append stuff to search queries, e.g. for search by prefix
Allow extensions to append stuff to search queries, e.g. for search by prefix
Status: NEW
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: incubator
  Show dependency treegraph
 
Reported: 2011-08-04 17:47 UTC by Robin Pepermans (SPQRobin)
Modified: 2013-12-13 19:48 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Robin Pepermans (SPQRobin) 2011-08-04 17:47:16 UTC
It should be possible to somehow search by prefix through the search box. It's possible through inputbox.

(Note that this is only possible in Lucene search, but that is used on WMF wikis anyway.)

It would be extremely useful for Incubator to be able to search within a specific test wiki.
Comment 1 Robert Stojnic 2011-08-04 18:36:37 UTC
Can you be more specific? You can search by prefix by doing a query like this:
<your query> prefix:<the page prefix>
Comment 2 Robin Pepermans (SPQRobin) 2011-08-04 18:47:57 UTC
Well, yes, it should be somehow configurable by an extension.

For example, based on the current title e.g. "Prefix/Subpage", an extension should be able to set the prefix in the searchbox to "Prefix" (and preferably not by a visible "prefix:Prefix" in the searchbox but rather by passing through a &prefix= parameter).
Comment 3 Brion Vibber 2011-08-04 20:24:11 UTC
That there's some specific support for search form queries accepting a 'prefix' query string parameter which gets passed through to the underlying search engine (currently only supported by Lucene via MWSearch extension, by sticking a 'prefix:'+val into the query in its transformSearchTerm method.)

This I think got introduced for use with the <inputbox> extension and is used fairly extensively to create custom search forms within various project hierarchies on some of our wikis.

For use on, say, Incubator, it could be *really* nice to have the search box default to looking within the current language/project.


I suspect we can hack this up for Incubator extension in some way; adding a hidden field with the 'prefix' field value to the search form should do the job. If it's not directly manipulable through a hook, one could probably add it from JavaScript at runtime; not ideal but should be possible as a quick fix.

It would also help to implement the prefix support in the default MySQL search engine, as this would certainly aid folks testing the Incubator extension. This should be broken out to a separate bug though.
Comment 4 Brion Vibber 2011-08-16 18:54:28 UTC
See also bug 30404 -- a more general way to append stuff into the search query could be helpful. On the other hand that could also be handled by a smarter input box system that handles the appending and just sends you on to the search page with a full query.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links