[ 
https://issues.apache.org/jira/browse/LUCENE-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul Elschot updated LUCENE-6276:
---------------------------------
    Attachment: LUCENE-6276.patch

2nd patch of 15 October 2015.

This adds Span.positionsCost() as the basic matchCost to be used for Spans.
This method has a NOCOMMIT in Spans.java: throw UOE or abstract in Spans?
I'd prefer to throw an UOE but an abstract method is easier to make find the 
places where positionsCost() really needs to be implemented.
For now I left it abstract and have some implementations throw UOE.

Other changes to the previous patch:
Use TermStatistics from trunk.
Move expTermFreqInMatchingDoc() from TermStatistics into PhraseWeight and a 
copy into TermSpans.
Simplified matchCost() implementations.

Existing tests pass.

This will need improvements, and I hope it works decently for simple cases like 
a conjunction over a phrase and a SpanNear.


> 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
>
>
> 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]

Reply via email to