开发者

Rewrite query in lucene

开发者 https://www.devze.com 2023-03-21 12:18 出处:网络
When lucene want to compute weight of q开发者_开发技巧uery it first call searcher.rewrite(Query),what does this function do for each types of query?The query rewriter turns higher-level query clauses

When lucene want to compute weight of q开发者_开发技巧uery it first call searcher.rewrite(Query),what does this function do for each types of query?


The query rewriter turns higher-level query clauses into lower-level clauses that perform better. The end result is functionally identical.

For example, the javadoc for Query.rewrite says:

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

If Lucene is to perform an accurate query cost analysis, it needs to rewrite the query into its fastest form.

0

精彩评论

暂无评论...
验证码 换一张
取 消