Topic on Project:Support desk

Search will not show any results under custom namespaces

8
Averymechanix (talkcontribs)

Hi,

I am having an issue getting the search function to work with custom namespaces. When using the search function it will only return results for pages in the Main namespace. My LocalSettings.php looks like the following for my custom namespaces.


##Define constants for additional namespaces.

define("NS_B142",3000);

define("NS_B142_TALK",3001);


##Add Namespaces.

$wgExtraNamespaces[NS_B142] = "B142";

$wgExtraNamespaces[NS_B142_TALK] = "B142_Talk";


##Defaults search to allow all namespaces to be searched. 

$wgNamespacesToBeSearchedDefault[NS_B142] = true;

$wgNamespacesToBeSearchedDefault[NS_B142_TALK] = true;


MarkAHershberger (talkcontribs)

What version of MW are you using? If your wiki is public, can you point us to it?

Averymechanix (talkcontribs)

It is an internal wiki unfortunately, however, I am using version 1.29.1.

When you look at Special:All Pages it does show all of my namespaces in the wiki (the example above is only one of 6). I am using namespaces to separate buildings and sections so that no one steps on each others test instructions (We all use the same equipment).

MarkAHershberger (talkcontribs)

When you do advanced search and manually select the other namespaces, do you see results from those namespaces?

Are you using CirrusSearch or the built in search?

Averymechanix (talkcontribs)

Built-In search. It does not show me the other namespaces (no option to search under them) when I try and do advanced search.

MarkAHershberger (talkcontribs)

If your custom namespaces do not show up in the advanced search, then MediaWiki's search probably isn't aware of them.

Are you sure that pages in the "B142" namespace are actually in that namespace and aren't just in the main namespace with "B142:" at the beginning of their title? One way to tell is what the first tab says. For the main page it will usually say "Main Page" while other pages in the main namespace will say something like "Page". On this topic thread, for example, they say "Topic".

For your "B142" namespace, the tab should say "B142".

Averymechanix (talkcontribs)

The tab says B142. Also when looking at "All Pages" in the Special pages, I can select to see pages only under namespace B142. Only the search does not work.

MarkAHershberger (talkcontribs)
Reply to "Search will not show any results under custom namespaces"