[
https://issues.apache.org/jira/browse/LUCENE-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14963540#comment-14963540
]
Paul Elschot commented on LUCENE-6276:
--------------------------------------
bq. an average number of operations that need to be performed in matches(), so
that you would add +1 every time you do a comparison, arithmetic operation,
consume a PostingsEnum, etc.
That sounds doable. The Lucene50PostingsReader takes about such 7 operations
for a nextPosition() call in case it does not seek and/or refill its buffer. I
assume that would be the cost of consuming a PostingsEnum.
bq. The cost of reading the N+1 position is generally going to be much cheaper
than reading the very first position since the first once possibly involves a
seek.
To take that into account an estimation of the seek/refill cost per term could
be added in once per document.
bq. we may need to percolate the matchCost concept further into other APIs –
namely ValueSource/FunctionValues
Could that be done at another issue?
> 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
> Attachments: LUCENE-6276-ExactPhraseOnly.patch,
> LUCENE-6276-NoSpans.patch, LUCENE-6276-NoSpans2.patch, LUCENE-6276.patch,
> LUCENE-6276.patch, LUCENE-6276.patch, LUCENE-6276.patch
>
>
> 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]