When we go to special:search/blah now, if [[foo]] exists the search page will redirect us to [[foo]].
Is it possible for the special:search logic to take us to [[category:foo]] if [[foo]] doesnt exist and [[category:foo]] does?
This could be useful on Commons where there is often have a well maintained category structure with better results than the search results, and gallery pages ([[foo]]) are not as well maintained.
-- John Vandenberg
On 14 October 2011 10:42, John Vandenberg jayvdb@gmail.com wrote:
When we go to special:search/blah now, if [[foo]] exists the search page will redirect us to [[foo]]. Is it possible for the special:search logic to take us to [[category:foo]] if [[foo]] doesnt exist and [[category:foo]] does? This could be useful on Commons where there is often have a well maintained category structure with better results than the search results, and gallery pages ([[foo]]) are not as well maintained.
+1 - great idea!
- d.
On 10/14/2011 11:42 AM, John Vandenberg wrote:
When we go to special:search/blah now, if [[foo]] exists the search page will redirect us to [[foo]].
Is it possible for the special:search logic to take us to [[category:foo]] if [[foo]] doesnt exist and [[category:foo]] does?
This could be useful on Commons where there is often have a well maintained category structure with better results than the search results, and gallery pages ([[foo]]) are not as well maintained.
I guess you could make some Javascript code, similar to Wiktionary's Auto-Redirect. If you enter http://en.wiktionary.org/wiki/Technocracy for example, you get redirected to http://en.wiktionary.org/wiki/technocracy?rdfrom=Technocracy
See section "URL fixes" here: http://en.wiktionary.org/wiki/MediaWiki:Common.js
I'm not sure whether it would work with Special:Search, though.
--Tobias
Is it possible for the special:search logic to take us to [[category:foo]] if [[foo]] doesnt exist and [[category:foo]] does?
This should be an easy wiki extension to write, using the hook SpecialSearchGo(&$title, &$term). Just check for the existence of the article and the category, and modify the title correspondingly.
DanB
On Sat, Oct 15, 2011 at 4:33 AM, Daniel Barrett danb@vistaprint.com wrote:
Is it possible for the special:search logic to take us to [[category:foo]] if [[foo]] doesnt exist and [[category:foo]] does?
This should be an easy wiki extension to write, using the hook SpecialSearchGo(&$title, &$term). Just check for the existence of the article and the category, and modify the title correspondingly.
It looks like there is some code to check for an appropriate page, with a bit of fuzzy logic.
e.g. there is no enwp page "1964 Brinks Hotel Bombing" with a capital B in Bombing
http://enwp.org/1964_Brinks_Hotel_Bombing
however Special:Search will go directly to the right page
http://enwp.org/Special:Search/1964_Brinks_Hotel_Bombing
I think it would be useful to have an array of namespaces to automatically redirect to.
On Wikisource it would be nice if the 'Author' namespace was part of this "did you mean" automatic redirection.
e.g.
http://enws.org/Special:Search/Mark_Twain
could take the browser directly to
http://en.wikisource.org/wiki/Author:Samuel_Langhorne_Clemens
This would remove the need to have a "author=yes" parameter on enwp {{Sister project links}}
-- John Vandenberg
Am 15.10.2011 14:45, schrieb John Vandenberg:
On Sat, Oct 15, 2011 at 4:33 AM, Daniel Barrett danb@vistaprint.com wrote:
Is it possible for the special:search logic to take us to [[category:foo]] if [[foo]] doesnt exist and [[category:foo]] does?
This should be an easy wiki extension to write, using the hook SpecialSearchGo(&$title, &$term). Just check for the existence of the article and the category, and modify the title correspondingly.
It looks like there is some code to check for an appropriate page, with a bit of fuzzy logic.
Please check also if you can reuse http://www.mediawiki.org/wiki/Extension:TitleKey or parts of its code. I like that extension.
"TitleKey extension is a case-insensitive title prefix search plugin by Brion Vibber. It uses a separate table for the keys, so if it works cleanly it can be deployed without an expensive rebuild of core tables, and dumped when Wikimedia gets a nicer backend through Extension:LuceneSearch (pre 1.13) or Extension:MWSearch (1.13+)... This extension is being used on one or more of Wikimedia's wikis. This means that the extension is stable and works well enough to be used by such high traffic websites. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page."
wikitech-l@lists.wikimedia.org