Azure认知搜索 - 模糊搜索 - 在建议API和搜索API之间保持一致
我已经实现了使用搜索API的建议+自动完成的清单页面,但是在列表中所建议的内容和所拥有的内容之间,我无法获得一致的结果。
因此,我在建议模式下的查询是: https:// xxx/indexes/my-index/doc/supsimname = gentralsearchSuggester& top = 3& fuzzy = true& $ amp; $ select = sys_id = sys_id,name,url&url& search = nin& api-version = 2020-06-30 此返回3结果:
- nina
- nina25
- nick
及其搜索API我的查询是: https:// xxx/indexes/my-index/docs?api-version = 2020-06-06-30& count = true& queryType = full& searchMode = anemp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;%24SKIP = 0&%24Top = 16&amp = 16& amp = 16& cearch = = = = = = = nin*〜1&%24select =命名
此返回2结果:
- 尼娜
- NINA25
在此页面中: httpps:/ -US/REST/API/SEECHSERVICE/建议我看到“编辑距离为每个查询字符串“我想这对应于〜1,但我不明白如何使其保持一致。
问候,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的搜索示例中,您将使用模糊搜索的通配符搜索组合。使用,请从查询中删除 * *,然后直接使用Tilde字符指定编辑距离。
这将与拼写距离为1。nin〜1
自动完成vs搜索
自动完成建议的目的是为您提供有关搜索内容的模糊建议。它告诉您,您可以搜索Nina,Nina25或Nick。在搜索这些术语时,您将获得包含令牌Nina(或Nina25或Nick)的所有结果。
In your search example you are using a combination of a wildcard search with fuzzy search. To use fuzzy search as documented, remove the * from your query and specify the edit distance with the tilde character directly.
This will match tokens with a spelling distance of 1.
Autocomplete vs Search
The intent of the autocomplete suggester is to give you fuzzy suggestions on what to search for. It's telling you that you can search for either nina, nina25 or nick. When searching for these terms you will get all the results containing the token nina (or nina25 or nick).