I could search all namespaces in my search bar but after enabling TitleKey, in order to make queries case insensitive, I can now only search for items in the main namespace. Is there a specific reason why this happens?
Topic on Extension talk:TitleKey
Yep, it's indeed something with TitleKey. I disabled it and while I can no longer use case insensitive queries (like "first last" for "First Last" or "first Last"), contents of all namespaces show up again. Kind of a bummer, really...
I found the following (https://www.mediawiki.org/wiki/Manual_talk:$wgEnableMWSuggest#Adding_Namespaces) which tells exactly when the change to only search the Main namespace was enabled. I'm going to try and reverse the patch (it is, after all, 11 years later) and see if functionality returns for all namespaces. I'll let you know what I find out!
Ugh. No, I reversed the patch which did nothing, so I added the namespaces to the array. That made it so that I could type in the namespace name (like Template:) but the only results showing were items in the main namespace (no matter which namespace I tried). It was the same thing after disabling the extension so I re-enabled it, re-edited the file, removed the array and tried rebuilding title keys. Nothing. Could still type, for example, Template: and only results from the main namespace were displayed. After disabling it again, running update.php was the only way to restore the ability to search namespaces other than main. I'd rather be able to search all namespaces efficiently than having case insensitive searches only in the main namespace. Oh well, maybe one day that functionality will be added.
Reversing that patch is necessary, but not sufficient.
There was a refactor of MediaWiki core in 2016 (or possibly earlier) that introduced a bug in the PrefixSearchBackend hook that the extension uses - extensions that use that hook can't suggest pages that aren't in the main namespace.
There's a Gerrit patch that would fix that bug, but it hasn't yet been merged: Gerrit change 641277.
I spent far too long being baffled by this behaviour and trying to track down the cause - hopefully this helps if someone else finds themselves in the same situation.
"With MediaWiki 1.35 or earlier it breaks search suggestions for pages that are not in the main namespace" seems wrong. We had 1.31.15 and the Extension worked fine. After upgrading to MW 1.35.4 we encountered the problem described above: no more search suggestions when typing <namespace>:<searchstring>. I've just removed TitleKey, then namespace search works as expected. Moreover, the search string is still case-insensitive. Seems as if this extension is no longer necessary in MW 1.35.