If I search on http://www.mediawiki.org for "Search Weighting" I get as result a line: "Search (section Search Weighting Ideas)" with links to the page and to the section.
This section contains the word "GeoLoc". But if I search for "GeoLoc" I get just the page link.
I want to show this section link as a search result too.
Is there an easy way or is it a planned feature?
What do I have to change in the CirrusSearch extension?
Many Thanks! Henry
On Fri, May 9, 2014 at 8:32 AM, J jollylittlebottom < jollylittlebottom@hotmail.com> wrote:
If I search on http://www.mediawiki.org for "Search Weighting" I get as result a line: "Search (section Search Weighting Ideas)" with links to the page and to the section.
This section contains the word "GeoLoc". But if I search for "GeoLoc" I get just the page link.
I want to show this section link as a search result too.
Is there an easy way or is it a planned feature?
What do I have to change in the CirrusSearch extension?
Right, the "(section *Search Weighting* Ideas)" bit is populated by matching query terms to the section titles rather then doing something in combination of the text snippet below. This can lead to it sometimes showing a snippet from one section and a section heading from another. Let me have a think about how to make that better....
Nik
Ok, there might be a problem when a searched term appears in a section header and in other parts of a page.
But we have another problem. We have long pages in our mediawiki. If a user search for a term he just receive the link to a page. On this page he has to search for the term again with the browsers search tool to find the right place with the term. We will make this easier and present always additionally a link to the section where the term is first found.
I implemented this by adding the complete html text of all pages to the elasticsearch index. As search result I receive the highlighted text together with the complete html text. After extracting the highlighted term I extract the section header for this term from the html text and set sectionSnippet and sectionTitle in class CirrusSearch\Result. This works but is not really smart and not suitable for bigger wikis.
Is there a better way? Is it possible to show all section links up the hierarchy (h1, h2, ...) too?
Many Thanks! Henry
wikitech-l@lists.wikimedia.org