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

Michael McCandless commented on LUCENE-3474:
--------------------------------------------

I think int flags would work well?  We only have 2 flags here, plus
required acceptDocs.

The vast majority of cases use the default flags:

{noformat}
  new ScorerContext(acceptDocs);
{noformat}

And then for the few places that change the flags it'd be something
like this:

{noformat}
  new ScorerContext(acceptDocs, ScorerFlags.TOP_LEVEL);
{noformat}

We keep final-ness for the fields.

This seems like a great solution?

Failing that.... another option would be to just stop using an object
here at all, and go back to passing explicit flags down to
Weight.scorer.

In fact one benefit of this is we get stronger typing, ie, we force at
compilation time all Scorer impls to be fixed to handle the new
setting (vs today where a Scorer can easily silently be missed, thus
adding latent bug).

This means on any addition to the scorer API (eg I've long wanted for
caller to declare up front whether they need scores computed vs "only
matching", ie MTQWF and CSQ would pass false), we break the API.  But
I think that's actually fine, even in 3.x: making your own Scorer is
very expert.

                
> pass liveDocs Bits down in scorercontext, instead of Weights pulling from the 
> reader 
> -------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3474
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3474
>             Project: Lucene - Java
>          Issue Type: Task
>    Affects Versions: 4.0
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>         Attachments: LUCENE-3474.patch, LUCENE-3474.patch
>
>
> Spinoff from LUCENE-1536, this would allow filters to work in a more flexible 
> way (besides just cleaning up)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to