azure - 在 Azure 认知搜索中应用 EdgeNGram 自定义分析器时,文档亮点为空/空
问题描述
我们正在使用 Azure 认知搜索为客户构建文档搜索引擎。我们正在尝试在“内容”字段(文件的内容,base64 编码)上应用自定义分析器。
这是分析器的定义:
"analyzers": [
{
"@odata.type": "#Microsoft.Azure.Search.CustomAnalyzer",
"name": "pri_standard",
"tokenizer": "standard_v2",
"tokenFilters": [
"lowercase",
"asciifolding",
"phonetic"
],
"charFilters": []
},
{
"@odata.type": "#Microsoft.Azure.Search.CustomAnalyzer",
"name": "pri_custom_analyzer",
"tokenizer": "EdgeNGram",
"tokenFilters": [
"lowercase",
"pri_edgeNGram"
],
"charFilters": []
}
],
以下是它在索引字段中的应用方式
"fields": [
{
"name": "content",
"type": "Edm.String",
"searchable": true,
"filterable": false,
"retrievable": true,
"sortable": false,
"facetable": false,
"key": false,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "pri_custom_analyzer",
"synonymMaps": [
"industry-synonyms2"
]
},
令牌过滤器定义
"tokenFilters": [
{
"@odata.type": "#Microsoft.Azure.Search.EdgeNGramTokenFilterV2",
"name": "pri_edgeNGram",
"maxGram": 15,
"side": "front"
}
],
当我们搜索索引时,Document Highlights 字段始终为空。当我们应用标准分析器时,它可以正常工作,即我们得到正确返回的文档亮点。我们在这里做错了什么?
解决方案
推荐阅读
- java - JDBC 库在 Android Studio 中不起作用
- javascript - 如何使用计数器获取对象属性
- oracle - 更改 Oracle 11g 系统密码
- outlook-web-addins - 有没有办法在“to”或“cc”字段中获取所有收件人?
- android - 有没有人从美国成功向中国腾讯应用商店提交安卓应用?
- java - 为什么要编译 Java 正则表达式?
- reactjs - React OnClick 函数不会绑定,“this”仍然显示未定义
- vhdl - VHDL 综合工具不会推断 FSM
- mysql - MySQL (5.7.21) 外键约束解析顺序
- visual-studio - 构建错误:QtVS 2015 控制台应用程序项目中的 LNK2019 和 LNK1120