Searching with quoted term doesn't highlight the whole term

Continuing the discussion from The term "" creates trouble for search:

I’d expect it to highlight the whole term, but it highlights just arbitrary words.


You don’t need the quotes for an exact term match :wink:

If this is an easy fix we should fix it @sam


Looks to me like the highlighter just needs to strip out the quotes.

It’s still not highlighting the quoted term and now it shows double quotes for the search term.


I want to get to fixing this but its a fairly involved fixed, the highlighter needs to understand this behavior, it only highlights words now not full terms.

I really, really want this fixed, it is pretty disastrous from a UI perspective, also I’m not even sure it’s searching for a full quoted phrase in this scenario?

Done per:


I changed it so we only match whole words, centralized the highlighting code and deal with exact terms.


One interesting edge case here is that the really being in italics in your post breaks the algorithm.

Cause we match the index and then try to match raw, we are going to have to change it to try to do the exact match on a normalized text only version of the post.