Last modified: 2012-05-08 13:55:04 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 T32404, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30404 - InputBox:Possibility to insert entered string in a predefined search containing boolean operators
InputBox:Possibility to insert entered string in a predefined search containi...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
InputBox (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-16 18:43 UTC by Gustronico
Modified: 2012-05-08 13:55 UTC (History)
2 users (show)

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


Attachments

Description Gustronico 2011-08-16 18:43:46 UTC
Currently you can perform searches like these:
*incategory:"Heads of state" incategory:"YYYY deaths"
*fish incategory:"Chefs"
*intitle:"John" incategory:"American comedy writers"

Well, suppose you insert this code in [[Category:Heads of state]] or any other 'people' category page:
<inputbox>
type=search
boolean=incategory:"{{PAGENAME}}" incategory:"$1 deaths"
width=4
searchbuttonlabel=Find {{PAGENAME}} dead in a given year
</inputbox>

Or this simpler one in any category page:
<inputbox>
type=search
boolean= $1 incategory:"{{PAGENAME}}"
searchbuttonlabel=Find a word in this category
</inputbox>

Where 'boolean' is the requested new parameter with a unique wildcard (ie. $1 or %s). Using the 'default' parameter to define a boolean search results in an annoying *visible* text in the input box.
Comment 1 Brion Vibber 2011-08-16 18:53:12 UTC
Note that this *almost* works:

<inputbox>
type=search
prefix="" incategory:"{{PAGENAME}}" incategory:"$1 deaths"
width=4
searchbuttonlabel=Find {{PAGENAME}} dead in a given year
</inputbox>

The stuff in the 'prefix' value gets stuffed into the query with a magic 'prefix:' prepended to it; alas searching a blank prefix doesn't work. :(

This system could use some general improvement as well, it's a bit of a hack at the moment -- see bug 30229.
Comment 2 Gustronico 2011-08-17 00:14:17 UTC
If you're looking for a hack, I think 'default' parameter is better than 'prefix'. Both these work fine:

<inputbox>
type=fulltext
default=" your phrase here "               incategory:"{{PAGENAME}}"
searchbuttonlabel=Search for a phrase in this category
width=18
break=no
</inputbox>

<inputbox>
type=fulltext
default=your words here               incategory:"{{PAGENAME}}"
searchbuttonlabel=Search some words in this category
width=15
break=no
</inputbox>

Note that box width is short enough to hide the expressions on the right. But cannot still insert a string in the middle of more complex boolean expressions.

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


Navigation
Links