lucene - Azure 搜索中的模糊搜索和邻近搜索

标签 lucene azure-cognitive-search

需要有关查询的帮助,以便在 Azure 中组合邻近搜索和模糊搜索。索引包含以下项目:

  1. 华盛顿大学
  2. 玛丽华盛顿大学基金会
  3. 华盛顿复临大学

搜索词: 华盛顿大学 -(大学拼写错误)

这应该返回记录 1。即大学的模糊匹配和其余词的邻近匹配。

最佳答案

来自 Azure 搜索文档:

Fuzzy Search

To do a fuzzy search, use the tilde "~" symbol at the end of a single word with an optional parameter, a number between 0 and 2 (default), that specifies the edit distance. For example, "blue~" or "blue~1" would return "blue", "blues", and "glue".

Proximity Search

Insert a tilde "~" symbol at the end of a phrase followed by the number of words that create the proximity boundary. For example, "hotel airport"~5 will find the terms "hotel" and "airport" within 5 words of each other in a document.

根据这个文档,我可以构造一个结合了模糊搜索和邻近搜索的查询

“Universty~ of~ Washington~”~5 

注意必须使用Lucene query syntax为了这个工作

关于lucene - Azure 搜索中的模糊搜索和邻近搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51681475/

相关文章:

lucene - 我可以自定义 Elastic Search 以使用我自己的停用词列表吗?

azure - 如何在 Azure 搜索中更新索引后自动更新文档

java - 从 Solr 组件代码访问停用词列表

java - 如何获取匹配请求的字段?

azure-cognitive-search - azure 搜索中插入和删除索引之间的延迟

azure - 配置 azure 搜索 IP 以连接到本地数据库

azure-cognitive-search - Azure 搜索突出显示部分匹配

json - Azure 认知搜索中返回的形状结果

java - 使用 Lucene 的 RegexQuery 时匹配的片段

c# - Java和C#中某些特性的具体性能差异