Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hit Highlighting in Azure Search Service

I am new to Azure Search Service, and I wanted to use the hit highlighting feature of Azure Search Service. I am using the .NET SDK NuGet package for azure search.
I used SearchParameter object to mention the hit highlight fields and also the Pre and Post Tag that I require.

searchParameters.HighlightFields = new[] { "Description"};
searchParameters.HighlightPreTag = "<b>";
searchParameters.HighlightPostTag = "</b>";
_searchIndexClient.Documents.Search(searchText, searchParameters);

I am expecting something like this:
SearchText: best
Result (Description) : The best product
The issue is that I do not see any difference in the result with/without using hit highlight. (Description Field is searchable)
Am I missing something?

like image 632
Pratik Bhattacharya Avatar asked Apr 09 '15 13:04

Pratik Bhattacharya


1 Answers

Hit highlighting results are exposed via the Highlights property of the SearchResultBase class: link

like image 101
Bruce Johnston Avatar answered Sep 28 '22 02:09

Bruce Johnston