[
https://issues.apache.org/jira/browse/LUCENE-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14909666#comment-14909666
]
Adrien Grand commented on LUCENE-6276:
--------------------------------------
bq. Perhaps this cost method can be renamed to for example
expectedMaxMatchingDocs() with these javadocs: This an expected upper bound of
the number of documents this iterator might match.
Personally I don't dislike "cost". Even if it does not carry very well the
meaning of what it measures, it does a pretty good job at carrying what to do
with the result of this method: if you have several iterators, you want to
consume the least-costly ones first.
bq. Would it make sense to put matchCost() at DocIdSetIterator?
The DocIdSetIterator abstraction does not have the concept of "matching", only
TwoPhaseIterator has it, so I think it would be awkward to have it on
DocIdSetIterator? TwoPhaseIterator feels like a more appropriate place to have
this method.
> Add matchCost() api to TwoPhaseDocIdSetIterator
> -----------------------------------------------
>
> Key: LUCENE-6276
> URL: https://issues.apache.org/jira/browse/LUCENE-6276
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Robert Muir
>
> We could add a method like TwoPhaseDISI.matchCost() defined as something like
> estimate of nanoseconds or similar.
> ConjunctionScorer could use this method to sort its 'twoPhaseIterators' array
> so that cheaper ones are called first. Today it has no idea if one scorer is
> a simple phrase scorer on a short field vs another that might do some geo
> calculation or more expensive stuff.
> PhraseScorers could implement this based on index statistics (e.g.
> totalTermFreq/maxDoc)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]