Thread:Extension talk:Lucene-search/How does Wikimedia add Redirects + Section links into its search results?

How does Wikimedia add redirects + section links into their search results?

For example, if you search the term 'maderia portugal' you get something similar to the following:


 * Ribeira Brava, Madeira (redirect from Ribeira Brava, Portugal)
 * Boal (grape) (section Maderia Boal)

By default, Lucene neither strips the formatting nor presents these additional links - which forces the user to the top of the page, having to either find the section they were looking for in table of contents or scroll through the page.

Is this handled by Lucene or MWSearch, or am I way out to left field?