Page MenuHomePhabricator

Restring search to subpages of a page
Closed, InvalidPublic

Description

There should be the ability to restrict search to a given page and its subpages.

For example, I want to restrict search to the page

https://en.wikiversity.org/wiki/Automatic_transformation_of_XML_namespaces

and its subpages like

https://en.wikiversity.org/wiki/Automatic_transformation_of_XML_namespaces/Draft_status

This make the ability to do search in an individual "book".


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=69658

Details

Reference
bz72285

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:52 AM
bzimport added a project: MediaWiki-Search.
bzimport set Reference to bz72285.
bzimport added a subscriber: Unknown Object (MLST).

You can already, utilise the prefix component as described on the search help. Have a look at how we have a template at English Wikisource to manage this directly
https://en.wikisource.org/wiki/Template:Engine

You should be able to import it directly and to have it work, though you probably will want to change the button text.

And if you don't have transwiki import set up from enWS, then try meta or mediawiki, as I migrated it to those wikis too.

Note. If you want to only do subpages, you just need to add a "/" at the end to force it to only look at subpages.

The search help page is at [[mw:Help:CirrusSearch]] and you should look at the "prefix:" component, and think usage like for "Special:PrefixIndex"

I want an <input type="text"> where I can easily enter the prefix.

The above described features are not enough.

This is already possible with the [[mw:Extension:InputBox]]. See the extension documentation page for more parameters.

For example, the following wikitext would produce https://en.wikiversity.org/w/index.php?oldid=1248385

<inputbox>
type=search
prefix=Automatic transformation of XML namespaces
</inputbox>

or type ... prefix:Automatic_transformation_of_XML_namespaces
into a search box, which is only several characters and no need to have a specialised search form, it works anywhere if you know the path