azure-cognitive-search - 转义特殊字符和使用 Azure 搜索选择正确分析器的问题
问题描述
我正在使用 Azure 索引进行索引搜索。
我创建了用于转义的自定义SWMLuceneAlongWithCustomHyphenAnalyser分析器-(特殊字符),如下所示
"analyzers":[
{
"name":"SWMLuceneAlongWithCustomHyphenAnalyser",
"@odata.type":"#Microsoft.Azure.Search.CustomAnalyzer",
"tokenizer": "keyword_v2",
"tokenFilters": [
"lowercase"
]
}
]
例如转义 - 我的索引搜索查询是。
&search=lowerSystemID:/.*ryan\-yeti\-win10.*/lowerMachineTag:/.*ryan\-yeti\-win10.*/&$select=lowerProductKey,lowerSystemID,lowerMachineTag&$filter=(lowerSystemID ne null)&$count=true&$top=999&queryType=full&$skip=0
此查询返回预期结果。
但是我们遇到了查询值的问题!@#$%^&*()*^w
如果存在,它应该返回数据,否则显示零结果。现在它返回所有记录。下面是转义所有特殊字符后的查询。不知道我在这里做错了什么,或者分析器可能不是正确的:
&search=lowerSystemID:/.*\!\@\#\$\%\^\&\*\(\)\*\^w.*/lowerMachineTag:/.*\!\@\#\$\%\^\&\*\(\)\*\^w.*/&$select=lowerProductKey,lowerSystemID,lowerMachineTag&$filter=(lowerSystemID ne null)&$count=true&$top=999&queryType=full&$skip=0
任何建议都会有所帮助!
解决方案
推荐阅读
- python-3.x - 添加多个隐藏层keras
- r - 对表格进行排序/排序/排名
- java - Does Google Cloud Speech API save my sound recordings?
- sql - Web 分析 SQL 表设计
- c# - 使用管理员更改 Windows 本地用户密码
- windows - How to obtain keyboard layout for Microsoft Edge and other windows hosted in ApplicationFrameHost.exe
- clojure - How to write a java varg function in clojure?
- python - 使用 boto3 将 csv 导出到 dynamodb
- python - Python 控制台:检测 Ctrl X 按键事件
- sql - 从 SQL 表在 SQL Server 中创建固定长度文件