[ https://issues.apache.org/jira/browse/LUCENE-2190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836164#action_12836164 ]
Michael McCandless commented on LUCENE-2190: -------------------------------------------- bq. Adding setNextReader to CustomScoreQuery makes the Query itsself stateful. This breaks when using together with e.g. ParallelMultiSearcher. Ugh, you're right. Passing the current IR to customScore method isn't great because then you have to a check per call (per doc scored) to detect a switch to a new reader. bq. but when we change to per-segment rewrite (as Mike plans) I'm not quite "planning" that ;) I was mulling it... because it's somewhat inefficient now that an MTQ uses the multi terms enum instead of doing it per segment. But: this is only done for the BQ rewrite, which is only done when the number of terms is smallish (with AUTO default rewrite), so I think in practice the actual cost is low? > CustomScoreQuery (function query) is broken (due to per-segment searching) > -------------------------------------------------------------------------- > > Key: LUCENE-2190 > URL: https://issues.apache.org/jira/browse/LUCENE-2190 > Project: Lucene - Java > Issue Type: Bug > Components: Search > Affects Versions: 2.9, 2.9.1, 3.0, 3.0.1, 3.1 > Reporter: Michael McCandless > Assignee: Michael McCandless > Fix For: 2.9.2, 3.0.1, 3.1 > > Attachments: LUCENE-2190.patch > > > Spinoff from here: > http://lucene.markmail.org/message/psw2m3adzibaixbq > With the cutover to per-segment searching, CustomScoreQuery is not really > usable anymore, because the per-doc custom scoring method (customScore) > receives a per-segment docID, yet there is no way to figure out which segment > you are currently searching. > I think to fix this we must also notify the subclass whenever a new segment > is switched to. I think if we copy Collector.setNextReader, that would be > sufficient. It would by default do nothing in CustomScoreQuery, but a > subclass could override. -- 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