模糊搜索不适用于 dismax 查询解析器
Fuzzy search not working with dismax query parser
我的架构 'fullText' 中有一个字段属于 'text_en' 类型,并且是多值的。术语 'tests' 在一个文档的全文字段中。
在 solr 中,当我尝试使用最小距离为 1 的标准 lucene 解析器使用单词 'test' 进行搜索时,它返回了文档。我使用的查询是:
http://localhost:8983/solr/simple/select?q=fullText:test~1&wt=xml&indent=true
但我正在使用 dismax 做同样的事情,但它没有返回文档。我尝试过的查询是:
http://localhost:8983/solr/simple/select?q=test&wt=xml&indent=true&defType=dismax&qf=fullText~1
http://localhost:8983/solr/simple/select?q=test~1&wt=xml&indent=true&defType=dismax&qf=fullText
DisMax 在设计上不支持其查询参数中的所有 lucene 查询语法。来自 the documentation:
This query parser supports an extremely simplified subset of the Lucene QueryParser syntax. Quotes can be used to group phrases, and +/- can be used to denote mandatory and optional clauses ... but all other Lucene query parser special characters are escaped to simplify the user experience.
模糊查询是不支持的内容之一。有一个request to add it to the qf
parameter,有兴趣的可以看看,但是没有实现
一个好的解决方案是转至 edismax
query parser。它的查询参数支持完整的 lucene 查询解析器语法:
http://localhost:8983/solr/simple/select?q=test~1&defType=edismax&qf=fullText
我的架构 'fullText' 中有一个字段属于 'text_en' 类型,并且是多值的。术语 'tests' 在一个文档的全文字段中。
在 solr 中,当我尝试使用最小距离为 1 的标准 lucene 解析器使用单词 'test' 进行搜索时,它返回了文档。我使用的查询是:
http://localhost:8983/solr/simple/select?q=fullText:test~1&wt=xml&indent=true
但我正在使用 dismax 做同样的事情,但它没有返回文档。我尝试过的查询是:
http://localhost:8983/solr/simple/select?q=test&wt=xml&indent=true&defType=dismax&qf=fullText~1
http://localhost:8983/solr/simple/select?q=test~1&wt=xml&indent=true&defType=dismax&qf=fullText
DisMax 在设计上不支持其查询参数中的所有 lucene 查询语法。来自 the documentation:
This query parser supports an extremely simplified subset of the Lucene QueryParser syntax. Quotes can be used to group phrases, and +/- can be used to denote mandatory and optional clauses ... but all other Lucene query parser special characters are escaped to simplify the user experience.
模糊查询是不支持的内容之一。有一个request to add it to the qf
parameter,有兴趣的可以看看,但是没有实现
一个好的解决方案是转至 edismax
query parser。它的查询参数支持完整的 lucene 查询解析器语法:
http://localhost:8983/solr/simple/select?q=test~1&defType=edismax&qf=fullText