在Azure搜索服务中突出显示重点 [英] Hit Highlighting in Azure Search Service
问题描述
我是Azure搜索服务的新手,我想使用Azure搜索服务的突出显示功能.我正在使用.NET SDK NuGet软件包进行天蓝色搜索.
我使用SearchParameter对象来提及点击突出显示字段,以及我需要的Pre和Post标签.
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);
我期望这样的事情:
SearchText:最佳
结果(说明):最佳产品
问题是使用/不使用匹配突出显示时,我看不到结果有什么不同. (描述字段是可搜索的)
我想念什么吗?
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?
推荐答案
突出显示的结果通过SearchResultBase
类的Highlights
属性公开:
Hit highlighting results are exposed via the Highlights
property of the SearchResultBase
class: link
这篇关于在Azure搜索服务中突出显示重点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!