Topic on Project:Support desk

MediaWiki search and keywords

9
Pompelpilt (talkcontribs)

Dear All.

I have a small internal MediaWiki installation up and running. After a couple of months in service, I got complaints from users saying that they don't get a hit on the expected page when they do a search in the search field of our MediaWiki installation. The reason is obvious - the don't get a hit in the text that's on the page and the content they are looking for. Is there a simple way to add a kind of meta keywords in an article to get a search hit?

I have read about YetAnotherKeywords and considering that option. Other possibilities seem to be CirriusSearch and SphinxSearch, but they seem to be more complicated. What does people use to resolve this issue on a smaller MediaWiki installation?

Regards

Temptuousinsolence (talkcontribs)

To make things a bit clearer:

  • MediaWiki with numerous sites and content
  • User uses search field in order to search for content on page
  • No hit displayed
  • Solution: You want content displayed.

Correct?

Question:

  • Do you want all content searchable or just some parts?
88.130.79.114 (talkcontribs)

When words are not displayed in the search results although they are on the according pages, this often is caused by problems with the search index. Try running the maintenance script rebuildtextindex.php in order to rebuild the search index!

Pompelpilt (talkcontribs)

It seems like I didn't make myself clear here.

For instance; If a user search for "PC" or "Computer", I would like to have a hit on an article "Personal Computer". In this case I would like to put in some keywords like one does in HTML with <meta name="keywords" content="HTML,CSS,XML,JavaScript">. How is that resolved in MediaWiki without typing them in the text itself?

FriedhelmW (talkcontribs)

Add the following to your CSS:

.keywords {
   display: none;
}

Then, you can write in your article:

<div class="keywords"> Foo, Bar, Blaz </div>
Pompelpilt (talkcontribs)

Great! That was a straight foreward solution. I assume it's MediaWiki:Common.css you are referring to?

Thanks! I'll give it a try!

Pompelpilt (talkcontribs)

It worked!

Had to add a 'div' though. Like this:

div.keywords {
  display: none;
}

Thanks FriedhelmW!

121.220.97.150 (talkcontribs)

Over qualifying the selector isn't necessary.

176.127.49.71 (talkcontribs)

You can also add your keywords as a comment in wikitext. Comments are supported in the visual editor, so they show up in the editor, but not in page display.

Reply to "MediaWiki search and keywords"