3

We have a azure web application where in there is one search box, when we enter text with double quotes like "App Service" it correctly list records with "App service" however it not only highlights "App Service" but it also highlights "App" as well "Service" if they are found individually, what can be done so that only "App service" is highlighted this will not create chaos among the users.

bahrens
  • 140
  • 7
harshu288
  • 141
  • 1
  • 12
  • 1
    Didn't you ask the same question earlier: http://stackoverflow.com/questions/42361449/azure-search-exact-phrase-matching? – Gaurav Mantri Feb 23 '17 at 09:15
  • I'm having the same exact problem...when performing a phrase search, it's highlighting not only the occurrence of the phrase, but also each individual word in the phrase. Maybe @yahnoosh can help with this one? – bahrens Mar 13 '17 at 13:15
  • Thanks @mike-mccaughan. I've read through that, and I don't believe this quite explains the issue I'm seeing. It's almost as if it's performing both a search on each term, and on the phrase, and I'm not sure why. – bahrens Mar 13 '17 at 18:29

1 Answers1

5

In Azure Search we use Lucene's Postings Highlighter. This highlighter ignores positions of terms that matched, that's why you see all phrase terms highlighted independently. Unfortunately there is no way to customize this behavior at the moment. I realize this could be confusing to your users.

Please use our UserVoice page to vote for changing the current behavior.

Yahnoosh
  • 1,932
  • 1
  • 11
  • 13
  • Ok, that makes sense. I've also noticed that some of the highlight snippets returned do not contain all of the terms from the phrase I searched for. Is that also expected behavior? – bahrens Mar 14 '17 at 11:47
  • 1
    This is because highlighting happens after the matched documents are identified. The Postings Highlighter takes each document matched, splits it into sentences a looks for sentences that matched the query terms best (ignoring term positions). We'll be revisiting how the highlighter works in Azure Search soon to address some of these confusing behaviors. – Yahnoosh Mar 14 '17 at 16:29
  • Here is the link to the request for additional highlighters that links back to this SO question https://feedback.azure.com/forums/263029-azure-search/suggestions/32661961-implement-other-highlighters – seangwright Aug 13 '19 at 16:58