Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6256

PostingsEnum impls should respect documented behavior when no positions exist

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.1, 6.0
    • None
    • None
    • New

    Description

      PostingsEnum.nextPositions says that if no positions exist, NO_MORE_POSITIONS will be returned on the first call (actually it refers to DocsEnum.NO_MORE_DOCS, which should be changed since DocsEnum doesn't exist on trunk). At least one impl (BlockDocsEnum) does assert false inside nextPosition(). This means if you have assertions turned on (e.g. in a test) you get an assertion here, when the behavior should return NO_MORE_POSITIONS. I'm still going through all the implementations, but I also see MultiTermHighlighting which returns Integer.MAX_VALUE. I think we should clean up all these implementations which have no positions (including maybe the fake scorers that are copied around in a lot of places?) to return NO_MORE_POSITIONS.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rjernst Ryan Ernst
            rjernst Ryan Ernst
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment