When I search for posts, I've noticed odd behavior with respect to highlighting of matching text in the search results.
Is this a bug? Will it be fixed?
Markup of the results is very useful, drawing the user's eye to relevant portions of the results that are visible. However, the markup done on Stack Overflow does not meet expectations, see:
- A search [tag] is not treated as text in searches, so should not be treated as such in the display of search results.
- There is no value to mark any text in the tag wiki displayed when searching for a single tag. (So no need to increase the tag's visibility with bold + highlight.)
- All single words searched for should be marked. This marking could be limited to the portion of the questions searched (
title:
vsbody:
), but doing both is acceptable. - All exact phrases (e.g.
"exact phrase"
) should be marked. Separate words making up the phrase should not. - Markings should stand out in both question titles and body snippets, to make them stand out to the user.
This isn't quite what we see today on Stack Overflow:
Example 1, a search on a single tag for a single word. The tag gets bold+highlight treatment in the tag wiki while the searched word is not marked, neither is marked in question titles, and both appear bold inside the text snippets in the search results.
Odd thing - c++ does not get marked, while javadoc does... presumably there is some logic deciding
c++
isn't a word because of the punctuation?Example 2, a search on the same single tag for an exact multi-word phrase. As before, but non-exact matches of the search phrase get marked in question snippets.