[
https://issues.apache.org/jira/browse/LUCENE-5487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13918788#comment-13918788
]
Michael McCandless commented on LUCENE-5487:
--------------------------------------------
bq. The javadocs of TopScorer are outdated. The firstDocId is no longer passed.
Woops I'll fix.
bq. I don't like this change, because in the default impl inside Weight.java,
we now need the additional code to check if scorer is still on -1 or not.
Yeah ... not sure what to do about it. It became hard to know the firstDocID
since consumers of TopScorer can't .nextDoc. Maybe there is another way ...
bq. (sorry the crazyness of this score(Collector, maxDoc) stuff is horrible to
understand, especially, if you want to implement it correctly!)
It is ... and I think we only have this version (the one that takes 2nd param,
int max) for the "BS1 embeds BS1" case? Maybe we don't need to optimize this
case? (Maybe a BQ embedded a BQ should rewrite itself to a single BQ, if
somehow we could account for the proper coord scoring).
bq. Another idea I had: we can make TopScorer an interface
That's a neat idea! So then e.g. IS.search (and BS1 embeds BS1 case) would
check if the Scorer it pulled impls TopScorer, and if so, cast it and call
.score(Collector); else, it would fallback to the default impl.
> Can we separate "top scorer" from "sub scorer"?
> -----------------------------------------------
>
> Key: LUCENE-5487
> URL: https://issues.apache.org/jira/browse/LUCENE-5487
> Project: Lucene - Core
> Issue Type: Improvement
> Components: core/search
> Reporter: Michael McCandless
> Assignee: Michael McCandless
> Attachments: LUCENE-5487.patch, LUCENE-5487.patch
>
>
> This is just an exploratory patch ... still many nocommits, but I
> think it may be promising.
> I find the two booleans we pass to Weight.scorer confusing, because
> they really only apply to whoever will call score(Collector) (just
> IndexSearcher and BooleanScorer).
> The params are pointless for the vast majority of scorers, because
> very, very few query scorers really need to change how top-scoring is
> done, and those scorers can *only* score top-level (throw throw UOE
> from nextDoc/advance). It seems like these two types of scorers
> should be separately typed.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]