[ 
https://issues.apache.org/jira/browse/LUCENE-6295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14337415#comment-14337415
 ] 

Adrien Grand commented on LUCENE-6295:
--------------------------------------

bq. Then we'd just be removing the IndexReader parameter from Query.rewrite().

But do we still need a rewrite() method? I was initially looking for a way to 
make queries easier to consume. For instance I started looking at replacing 
filters with queries in a couple of places (eg. the index splitter is a simple 
example) and having to call rewrite(until the same query is 
returned)+createWeight+scorer is quite heavy while on filters, you just need to 
call getDocIdSet.

I was hoping that we could make rewrite() an implementation detail of 
createWeight(). Especially given that you could still have access to the 
rewritten query by calling getQuery() on the created weight.

> Remove Query.rewrite?
> ---------------------
>
>                 Key: LUCENE-6295
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6295
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>
> Queries are a bit hard to consume because of their complicated workflow: your 
> first need to rewrite before creating a weight. Maybe we could simplify it 
> and make query rewriting part of creating the weight?
> If a user would like to have access to the rewritten query, he could still 
> call Query.createWeight(searcher, needsScores).getQuery() instead of 
> Query.rewrite?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to