Where can I configure my wiki's top right Search box to do only the traditional "Search" behavior (go to search results page) and _not_ do the "Go" behavior (go to an article if its title matches)?
The "Go" action may be appropriate for wiki's that aim wide and shallow at everything under the sun. My wiki however aims deep and narrow at one topic. I find the "Go" search behavior gets in the way of showing search results.
Here's what I've tried so far:
$wgVectorUseSimpleSearch=true; // makes the top right Search box show a simple search icon, which I like, instead of the "Search" and "Go" buttons, but it does the "Go" function.
$wgVectorUseSimpleSearch=false; // shows both the "Search" and "Go" buttons.
I want to show only the search _icon_ and have it do only the _traditional_ Search behavior. Where can I configure this?
Thanks,
Roger Teflpedia.com Mediawiki 1.20.2
I'm sure there is a better way but I have a hack that'll do it. Drop this in LocalSettings.php:
$wgHooks['SpecialSearchGo'][] = function($p) { $p[0] = null; return true; };
Tested against master branch so your results may vary.
Nik Everett
On Fri, Sep 6, 2013 at 5:00 PM, roger@rogerchrisman.com wrote:
Where can I configure my wiki's top right Search box to do only the traditional "Search" behavior (go to search results page) and _not_ do the "Go" behavior (go to an article if its title matches)?
The "Go" action may be appropriate for wiki's that aim wide and shallow at everything under the sun. My wiki however aims deep and narrow at one topic. I find the "Go" search behavior gets in the way of showing search results.
Here's what I've tried so far:
$wgVectorUseSimpleSearch=true; // makes the top right Search box show a simple search icon, which I like, instead of the "Search" and "Go" buttons, but it does the "Go" function.
$wgVectorUseSimpleSearch=false; // shows both the "Search" and "Go" buttons.
I want to show only the search _icon_ and have it do only the _traditional_ Search behavior. Where can I configure this?
Thanks,
Roger Teflpedia.com Mediawiki 1.20.2
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On Fri, Sep 6, 2013 at 2:33 PM, Nikolas Everett neverett@wikimedia.org wrote:
I'm sure there is a better way but I have a hack that'll do it. Drop this in LocalSettings.php:
$wgHooks['SpecialSearchGo'][] = function($p) { $p[0] = null; return true; };
Tested against master branch so your results may vary.
Hm, in MW1.20.2, for me that causes this error:
Fatal error: Cannot use object of type Title as array in /home/bilbo/public_html/teflpedia.com/LocalSettings.php on line 162
(line 162 being $p[0] = null;)
Any suggestions on a better way to stop the 'Go [direct to article]' behavior of the Search box?
Roger
On Fri, Sep 6, 2013 at 8:51 PM, roger@rogerchrisman.com wrote:
On Fri, Sep 6, 2013 at 2:33 PM, Nikolas Everett neverett@wikimedia.org wrote:
I'm sure there is a better way but I have a hack that'll do it. Drop this in LocalSettings.php:
$wgHooks['SpecialSearchGo'][] = function($p) { $p[0] = null; return true; };
Tested against master branch so your results may vary.
Hm, in MW1.20.2, for me that causes this error:
Fatal error: Cannot use object of type Title as array in /home/bilbo/public_html/teflpedia.com/LocalSettings.php on line 162
(line 162 being $p[0] = null;)
Any suggestions on a better way to stop the 'Go [direct to article]' behavior of the Search box?
Roger
Blindly I'd guess you could do this:
$wgHooks['SpecialSearchGo'][] = function($t) { $t = null; return true; };
If that doesn't work I'm out of hacks :)
Nik
$wgHooks['SpecialSearchGo'][] = function($t) { $t = null; return true; };
That works. It is live at http://teflpedia.com now.
What is $t? And what is []?
I don't really know PHP. Could you explain briefly what this snip is doing?
Thanks, Roger :)
On Sep 6, 2013, at 9:18 PM, roger@rogerchrisman.com wrote:
$wgHooks['SpecialSearchGo'][] = function($t) { $t = null; return true; };
That works. It is live at http://teflpedia.com now.
What is $t? And what is []?
I don't really know PHP. Could you explain briefly what this snip is doing?
Sure. Mediawiki can be extended by registering functions as hooks. We registered one designed to let you play with the results of the special search go action. The hook's first parameter is the found title. We set it to null which in this case is interpreted as not found. So the search action then proceeds to execute the search against the search backend and give you the search results.
This is not great for two reasons I can think of right now: 1. The page is still loaded from the database. We just ignore it. This is inefficient. 2. No one is going to maintain this snippet for you and when you upgrade it will break. Like, crash searches break. You'll have to switch to the other one I sent you. Unless we change how that hook works again between now and when you upgrade. Sorry, this isn't really very nice.
Now that I think about it, does the prefix search still work with that hack? By work I mean you should be able to select one of the entries that pops down under the search box as you type and it takes you to that article.
Nik
Sorry for typos. iPhone has autocorrect and likes to use it.
Thanks, Roger :)
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Now that I think about it, does the prefix search still work with that hack? By work I mean you should be able to select one of the entries that pops down under the search box as you type and it takes you to that article.
No, with the hack in place clicking on one of the drop down search suggestions takes you to the search results page for that value, not to an article page. That _is_ perhaps what I want. I want Search to take you to a search results page, so that a user may choose which page he wants.
Is the drop down list of search suggestions generated from a list of the wiki's page titles? Hm, I guess it is. I had not realized that. So how does one search the wiki's page texts? This whole search feature seems to be designed to take a user to a destination article directly whenever possible. I'm not sure that is best for my wiki because that page may not always be the one a user wants and without the search results page, how will he find the one he does want? By doing another search with more search terms? Hm, maybe we can all get used to this and maybe it will just work.
Argggg, and trying to change this designed in behavior may not be so easy for a chiefly point and click guy like me.
So I may decide to use the two button ('Go' + 'Search') Search box that I get when I set $wgVectorUseSimpleSearch to false, instead, especially if this hack is not going to work in future.
Thanks for the tips.
Roger
I've just realized that, using 'Simple search', all one has to do to get past the article title suggestions is lengthen ones search string till it no longer exactly matches any article titles. Then, and only then, does 'Simple search' take you to a search results page. Might this simply be something folks need to learn to do, by doing? And might it simply work? Are average users consistently so cleaver? Argggg. I think if we lead them in the right direction it will work fine. What do you think?
Roger
On Fri, Sep 6, 2013 at 8:27 PM, roger@rogerchrisman.com wrote:
Now that I think about it, does the prefix search still work with that hack? By work I mean you should be able to select one of the entries that pops down under the search box as you type and it takes you to that article.
No, with the hack in place clicking on one of the drop down search suggestions takes you to the search results page for that value, not to an article page. That _is_ perhaps what I want. I want Search to take you to a search results page, so that a user may choose which page he wants.
Is the drop down list of search suggestions generated from a list of the wiki's page titles? Hm, I guess it is. I had not realized that. So how does one search the wiki's page texts? This whole search feature seems to be designed to take a user to a destination article directly whenever possible. I'm not sure that is best for my wiki because that page may not always be the one a user wants and without the search results page, how will he find the one he does want? By doing another search with more search terms? Hm, maybe we can all get used to this and maybe it will just work.
Argggg, and trying to change this designed in behavior may not be so easy for a chiefly point and click guy like me.
So I may decide to use the two button ('Go' + 'Search') Search box that I get when I set $wgVectorUseSimpleSearch to false, instead, especially if this hack is not going to work in future.
Thanks for the tips.
Roger
On Sep 7, 2013 12:18 AM, roger@rogerchrisman.com wrote:
I've just realized that, using 'Simple search', all one has to do to get past the article title suggestions is lengthen ones search string till it no longer exactly matches any article titles. Then, and only then, does 'Simple search' take you to a search results page. Might this simply be something folks need to learn to do, by doing? And might it simply work? Are average users consistently so cleaver? Argggg. I think if we lead them in the right direction it will work fine. What do you think?
have you tried clicking the entry below the suggestions? (where it says "containing…") see attachment
-Jeremy
Sent from my iPhone
On Sep 7, 2013, at 12:27 AM, roger@rogerchrisman.com wrote:
have you tried clicking the entry below the suggestions? (where it says "containing…") see attachment
-Jeremy
Yes Jeremy. Thanks, just discovered that a moment ago. I guess others can "discover" it, too. Hope so.
Roger
You can prefix a search with ~ and that'll force a search but that isn't intuitive either.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Wait!
At the bottom of the 'Simple search' search box's drop down suggestion list is a final item in a shaded box that reads 'Containing: <search sting here>'. Selecting that takes you to a search results page. Aha!
Why am I only now learning this? Maybe I'm a model average user? Not likely. But it is learning by playing. So maybe others can do it, too? What do you think?
Roger
On Fri, Sep 6, 2013 at 9:18 PM, roger@rogerchrisman.com wrote:
I've just realized that, using 'Simple search', all one has to do to get past the article title suggestions is lengthen ones search string till it no longer exactly matches any article titles. Then, and only then, does 'Simple search' take you to a search results page. Might this simply be something folks need to learn to do, by doing? And might it simply work? Are average users consistently so cleaver? Argggg. I think if we lead them in the right direction it will work fine. What do you think?
Roger
On Fri, Sep 6, 2013 at 8:27 PM, roger@rogerchrisman.com wrote:
Now that I think about it, does the prefix search still work with that hack? By work I mean you should be able to select one of the entries that pops down under the search box as you type and it takes you to that article.
No, with the hack in place clicking on one of the drop down search suggestions takes you to the search results page for that value, not to an article page. That _is_ perhaps what I want. I want Search to take you to a search results page, so that a user may choose which page he wants.
Is the drop down list of search suggestions generated from a list of the wiki's page titles? Hm, I guess it is. I had not realized that. So how does one search the wiki's page texts? This whole search feature seems to be designed to take a user to a destination article directly whenever possible. I'm not sure that is best for my wiki because that page may not always be the one a user wants and without the search results page, how will he find the one he does want? By doing another search with more search terms? Hm, maybe we can all get used to this and maybe it will just work.
Argggg, and trying to change this designed in behavior may not be so easy for a chiefly point and click guy like me.
So I may decide to use the two button ('Go' + 'Search') Search box that I get when I set $wgVectorUseSimpleSearch to false, instead, especially if this hack is not going to work in future.
Thanks for the tips.
Roger
Hi,
Have you considered a parallel solution like incorporating a custom Google Search into your site? It's highly configurable... HTH.
-- Dave
The search box's drop down suggestions menu could have better labels. For example, above the drop down menu's page suggestions we could put a "Go to page:" label. And instead of the "containing..." label above the last item, that takes you to a search results page, we could put "Search:". This would make it clearer what these menu choices do.
I successfully changed that label at bottom of the drop down menu from "containing..." to "Search:" by editing MediaWiki:Searchsuggest-containing.
Anyone have an idea how I can add a "Go to page:" label above the top part of the search box drop down menu?
Roger
Roger
On Sat, Sep 7, 2013 at 5:14 AM, me@x2592.com wrote:
Hi,
Have you considered a parallel solution like incorporating a custom Google Search into your site? It's highly configurable... HTH.
-- Dave
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Roger, on how to get clearer labels, the easiest way is IMHO to use monobook skin for your wiki. You are right that Vector was designed to push the "Go" behaviour; in general it was designed to make the most common things easier and all the others much harder.
Nemo
mediawiki-l@lists.wikimedia.org