search - 在lucene中重写查询

标签 search lucene rewrite

当 lucene 想要计算查询的权重时,它首先调用 searcher.rewrite(Query),这个函数对每种类型的查询做了什么?

最佳答案

查询重写器将高级查询子句转换为性能更好的低级子句。最终结果在功能上是相同的。

例如,Query.rewrite 的 javadoc 说:

Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

如果 Lucene 要执行准确的查询成本分析,它需要将查询重写为最快的形式。

关于search - 在lucene中重写查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6728941/

相关文章:

matlab - 在matlab中合并两个矩阵

ios - 使用 UISearchController 通过 API 进行搜索?

java - 正则表达式在代码中查找空注释

performance - 如何处理对 Lucene 索引的非常频繁的更新

solr - 使用 Solr ltr(学习排名)模块时如何使用用户点击来训练模型

php - 如何从 CodeIgniter 中的 URL 中删除段

architecture - DDD,反腐败层,如何做?

Python最快的n针到n haystacks字符串替换

java - 重写到文件中

mysql - Elasticsearch如何匹配一个二维数组?