Erathia
Erathia

Reputation: 45

How to get exact part where azure search found a match

So I have azure search, and when I search for something in the content it gave me all of the text from file. Is there a way to find a part of the content where it found a match? Like one sentence before + sentence with match + sentence after or just index of the start for match and the length?

Upvotes: 1

Views: 405

Answers (1)

Corom - MSFT
Corom - MSFT

Reputation: 376

Yes. There is hit highlighting feature for exactly this purpose. To use it you specify the fields you want this information on in highlight member of the request (documented here). In your response you will get some text snippets with text surrounding the matches and the hit work marked with a tag of your choice (defaults to <em></em>).

Upvotes: 3

Related Questions