lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1754) Get rid of NonMatchingScorer from BooleanScorer2
Date Tue, 21 Jul 2009 06:07:14 GMT

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

Shai Erera commented on LUCENE-1754:
------------------------------------

That's a good point. IndexSearcher does not protect against this case (it only asserts the
filter is not null, but not the DISI returned from it).

bq. I guess it's been a blind spot. 

I think that you're right. And more than that, we don't have unit tests that cover these cases
(I believe there are some that cover a null Scorer, but not a null DISI). And I wonder how
this hasn't come up until now. I mean, the examples Mike gave above do not sound way too extreme
to me.

So does this mean we should document that scorer cannot be null? And if so, we make NonMatchingScorer
public and recommend to return it if the query does not expect to return any documents? We
can also make NMS not instantiable (is it a word?), with a static instance() method, but that's
a minor thing.

Or ... we leave everything as-is, and add some test cases which test this exactly, and change
QueryWrapperFilter to return NMS in case the scorer returned by Weight is null.

I think I prefer the first approach.

> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message