Searching with quoted term doesn't highlight the whole term

(Gerhard Schlager) #1

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.

Change to DD Mmm / Mmm 'YY for post dates
(Régis Hanol) #2

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

(Jeff Atwood) #3

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

(Kane York) #4

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

(Gerhard Schlager) #5

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

(Sam Saffron) #6

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.

(Jeff Atwood) #7

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?

(Sam Saffron) #8

Done per:


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

(Sam Saffron) #9

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.

(Sam Saffron) #10