Design issue Highlighting does not work reliably

Kirby

Well-known member
Affected version
2.2.2
If a search term is a stopword or appears as start of a word, it does get highlighted on the results page even though it was not being searched for.

Steps to reprodue
  1. Configure Enhanced Search to use built-in stopwords for German
  2. Add content with title "Robust, leicht, top, zuverlässig - mit Stoppfunktion - bis 300 oder 500 Euro - Test"
  3. Perform a search for "leicht zu" in titles only
Expected Result
"zu" does not get highlighted as part of "zuverlässig" as it was not searched for; ideally a notice should be shown that this term was ignored because it is a stopword

Actual Result
"zu" does get highlighted as part of "zuverlässig"
 
The result highlighting is done in via exact text matching in php rather than from elasticsearch's actual search results.

And depending on Elasticsearch configuration, "zu" will actually match "zuverlässig"
 
The result highlighting is done in via exact text matching in php rather than from elasticsearch's actual search results.

And depending on Elasticsearch configuration, "zu" will actually match "zuverlässig"
I know, that's why I am reporting this as a bug.

Highlighting should be done by the search implementation (if possible; Elasticsearch/Sphinx/Manticore do provide the required fuctionality), not XFs own magic - only the search engine itself does know "exactly" what actually did match.

The current output is confusing for users and we do get ongoing complaints about this.
 
Last edited:
While I understand the current highlighting implementation is not fully accurate, and I do agree it would be very nice to allow highlighting to be done by the search implementation, this is a bit of a design issue as it stands and any improvements would be better tracked as a suggestion.
 
Top Bottom