我们正在尝试使用Azure认知搜索为存储在Azure Blob存储中的文档启用全文搜索。我们需要的功能之一是显示特定文档的热门内容。
我们注意到,虽然搜索精确短语仅与包含该精确短语的那些文档正确匹配,但是针对短语中单个单词而不是完整短语返回高亮显示。
示例
对于短语“供应协议”,我们会突出显示“供应”和“协议”。
请求
{
"search": "\"supply agreement\"",
"select": "metadata_storage_name,metadata_storage_path,language",
"searchFields": "merged_content",
"highlight": "merged_content"
}
响应:
{
"@odata.context": "https://....search.windows.net/indexes('...')/$metadata#docs(*)",
"value": [
{
"@search.score": 0.047654618,
"@search.highlights": {
"merged_content": [
"Customer has agreed to engage Supplier to <em>supply</em> the Products and Supplier has agreed to accept the engagement on the terms set out in this <em>Agreement</em>.",
"<em>Agreement</em>\n1.",
"Tax means goods and services, value added or similar consumption based tax applicable to the <em>supply</em> of the Products under this <em>agreement</em>.",
...
]
},
"metadata_storage_name": "a2b23e30-c1e0-4c52-a659-d8705662d699.docx",
"metadata_storage_path": "...",
"language": "en"
},
...
]
}
这是当前版本的Azure Cognitive Search API的已知问题吗?
答案 0 :(得分:2)
当前没有办法突出显示整个短语,但对您来说我有个好消息。 突出短语的工作是我们正在跟踪并计划发布的工作,尽管我还没有具体的发布日期。
Luis Cabrera-首席项目经理-Azure认知搜索