Re: [Wikitech-l] special:search/foo redirect to category:foo
Am 15.10.2011 14:45, schrieb John Vandenberg: > On Sat, Oct 15, 2011 at 4:33 AM, Daniel Barrett 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." signature.asc Description: OpenPGP digital signature ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] special:search/foo redirect to category:foo
On Sat, Oct 15, 2011 at 4:33 AM, Daniel Barrett 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 ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] special:search/foo redirect to category:foo
>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 ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] special:search/foo redirect to category:foo
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 signature.asc Description: OpenPGP digital signature ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] special:search/foo redirect to category:foo
On 14 October 2011 10:42, 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. +1 - great idea! - d. ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
[Wikitech-l] special:search/foo redirect to category:foo
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 ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l