[ 
https://issues.apache.org/jira/browse/LUCENE-6226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14311941#comment-14311941
 ] 

Adrien Grand commented on LUCENE-6226:
--------------------------------------

bq. The PostingsEnum contract is that you should only call .nextPosition() up 
to .freq() times

If this is the case then TermScorer doesn't have to count how many times 
nextPosition() has been called since Scorer extends PostingsEnum?

I have to admit I would need to think more about the pros/cons of either 
expecting nextPosition to not be called more than freq() times or lazily 
iterate over positions and return NO_MORE_POSITIONS when finished. By the way, 
the documentation looks wrong today since PostingsEnum.nextPosition says that 
it returns NO_MORE_POSITIONS when finished while eg. BlockPostingsEnum does not 
seem to do it?



> Allow TermScorer to expose positions, offsets and payloads
> ----------------------------------------------------------
>
>                 Key: LUCENE-6226
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6226
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>             Fix For: Trunk, 5.1
>
>         Attachments: LUCENE-6226.patch, LUCENE-6226.patch
>
>




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