I just added the following, and it works fine.
$wgContentNamespaces = [ NS_CATEGORY, NS_MAIN ];
I just added the following, and it works fine.
$wgContentNamespaces = [ NS_CATEGORY, NS_MAIN ];
It would be nice to allow it on the "mw-searchInput" class as well:
diff --git a/resources/ext.mnss.search.js b/resources/ext.mnss.search.js index 0a3e666..88e9149 100644 --- a/resources/ext.mnss.search.js +++ b/resources/ext.mnss.search.js @@ -51,7 +51,7 @@ } $( document ).ready( function () { - var $searchInput = $( '#searchInput' ); + var $searchInput = $( '#searchInput, .mw-searchInput' ); $searchInput.suggestions( { fetch: function ( query ) {
It seems to be down to the TitleKey extension, which purposely strips off the namespaces. Hacking that extension fixed things for us.
Also we had to add a CSS rule to get the namespace lining up with the article title:
div.suggestions-result { white-space: inherit; }
Basically just comment out the stuff that purposely breaks namespaces:
diff --git a/TitleKey_body.php b/TitleKey_body.php index 63cf769..b0b7b87 100644 --- a/TitleKey_body.php +++ b/TitleKey_body.php @@ -140,10 +140,10 @@ class TitleKey { } static function prefixSearch( $namespaces, $search, $limit, $offset ) { - $ns = array_shift( $namespaces ); // support only one namespace - if( in_array( NS_MAIN, $namespaces ) ) - $ns = NS_MAIN; // if searching on many always default to main - +# $ns = array_shift( $namespaces ); // support only one namespace +# if( in_array( NS_MAIN, $namespaces ) ) +# $ns = NS_MAIN; // if searching on many always default to main + $ns = $namespaces; $key = self::normalize( $search ); $dbr = wfGetDB( DB_SLAVE );
We tried to make this extension work, but it seems that it is dependent on CirrusSearch and only worked after CS was installed.
I'm using it on my stock MediaWiki 1.27.1 installation. Not sure why it wasn't working for you.
Thanks for making this extension! I was getting a bunch of requests from my users about being unable to find things they were looking for. This should help out immensely.
Also, it seems to be working fine on 1.23.1 (at least for me anyway).
This post was posted by Rosencrantz~mediawikiwiki, but signed as Rosencrantz.