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

Tim Smith commented on LUCENE-1754:
-----------------------------------

Here's a couple of use cases where a Query should rewrite to 
null/NonMatchingQuery (in my opinion):
* Wildcard query that maps to 0 terms in the index
* range query that again maps to 0 terms in the index
* boolean query that has 0 clauses
* filter based constant score query that has 0 docs in it
* (and thats just in the in the lucene tree, nothing to do with custom query 
implementations)

Most of these situations would actually preempt needing to return null from a 
scorer, since the query would already have been rewritten to a 
NonMatchingQuery/null prior to asking for a scorer

BooleanQuery could then also do instanceof checks on return from clause 
rewrite. If a NonMatchingQuery/null is returned for a required clause, the 
BooleanQuery itself can rewrite to NonMatchingQuery, also, if a prohibited 
clause rewrites to NonMatchingQuery/null, that clause can be removed entirely, 
if an optional clause rewrites to NonMatchingQUery/null, that clause can also 
be removed safely

> Get rid of NonMatchingScorer from BooleanScorer2
> ------------------------------------------------
>
>                 Key: LUCENE-1754
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1754
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Shai Erera
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1754.patch
>
>
> Over in LUCENE-1614 Mike has made a comment about removing NonMatchinScorer 
> from BS2, and return null in BooleanWeight.scorer(). I've checked and this 
> can be easily done, so I'm going to post a patch shortly. For reference: 
> https://issues.apache.org/jira/browse/LUCENE-1614?focusedCommentId=12715064&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12715064.
> I've marked the issue as 2.9 just because it's small, and kind of related to 
> all the search enhancements done for 2.9.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to