使用分词器 "keyword_v2" 的 Azure 搜索中的客户分析器不会 return 包含 space 的搜索测试结果

Customer analyzer in Azure search with tokenizer "keyword_v2" doesn't return results for search test containing space

我在 Azure 搜索索引中创建了一个名为 machineTag 的字段,详细信息如下:

"analyzers": [
{
    "@odata.type": "#Microsoft.Azure.Search.CustomAnalyzer",
    "name": "SWMLuceneAlongWithCustomHyphenAnalyser",
    "tokenizer": "keyword_v2",
    "tokenFilters": [
        "lowercase"
    ],
    "charFilters": []
}

]

索引为

    {
        "name": "machineTag",
        "type": "Edm.String",
        "searchable": true,
        "filterable": true,
        "retrievable": true,
        "sortable": true,
        "facetable": true,
        "key": false,
        "indexAnalyzer": null,
        "searchAnalyzer": null,
        "analyzer": "SWMLuceneAlongWithCustomHyphenAnalyser"
    }

现在,此字段中有文本名为 "high Machine",但我的查询:

search=machineTag:/.*high\%20machine.*/&$count=true&$top=100&$skip=0&$filter=machineTag%20ne%20null&$queyType=full

没有 return 任何结果。我做错了什么吗?

如果我测试分析器,它 return 的结果如下所示,我的理解是转义 space 应该 return 结果: 输入正文:

  {
     "analyzer":"SWMLuceneAlongWithCustomHyphenAnalyser",
     "text": "high Machine"
  }

回复:

 {
    "@odata.context": "https://abcd/$metadata#Microsoft.Azure.Search.V2016_09_01.AnalyzeResult",


  "tokens": [
        {
            "token": "high machine",
            "startOffset": 0,
            "endOffset": 12,
            "position": 0
        }
    ]
}

以另一种方式提出问题,该字段将包含带有 space 和 * 字符的文本。如果分析器有误,请指教..

您指定的查询有效,查询参数名称中有错字。将 queyType 替换为 queryType :

search=machineTag:/.*high\%20machine.*/&$count=true&$top=100&$skip=0&$filter=machineTag%20ne%20null&queryType=full