A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

Global Wiki Search is not always good

Perle

The normal Wiki search goes through page titles and page content. If you want to have it looking on
page names alone, I see no means to do that.
Is there an extension which enables you to select parts of a page which should not be used for search?
I have an application where I want to control the vocabular of the search terms. What is the best way
to accomplish this?

Chicocvenancio

Looking at the category for search extensions, it seems CirrusSearch is the best way to this at the moment (this is what Wikimedia uses).

Tgr

You can use Special:Prefixsearch (or the API equivalent) to do prefix search in titles. The only other option is to use generic search, in which case semantics of the search query are entirely up to the extension handling search (and the default implementation is minimalistic). As Chicocvenancio said, CirrusSearch is the most powerful such extension and supports intitle: keywords in the search query. It requires you to set up an ElasticSearch cluster though.

Perle

I had the idea that this is impossible at the moment.
So I implemented my own search. The open problem
ist: How to include the search form into the wiki pages?

You may look at burkewiki.com. At the bottom of the
main page is a link to activate the search form. (Only
the second slot is working.)

Tgr

You can write your own search extension but I would expect it to be way more work than setting up CirrusSearch or semantic search, for less impressive results.

If you want to try it anyway, you should look at the CirrusSearch source code, and then the inline documentation of the core PHP classes it uses. I don’t think there is any high-level documentation on writing search extensions. (Filed T188476 about that.)