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

Bug in SegmentTermPositions if used for first term in the dictionary

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      When a SegmentTermPositions object is reset via seek() it does not move
      the proxStream to the correct position in case the term is the first one
      in the dictionary.

      The reason for this behavior is that the skipStream is only moved if
      lazySkipPointer is != 0. But 0 is a valid value for the posting list of
      the very first term. The fix is easy: We simply have to set lazySkipPointer
      to -1 in case no lazy skip has to be performed and then we only move the
      skipStream if lazySkipPointer!=-1.

      1. lucene-955.patch
        3 kB
        Michael Busch

        Activity

        Hide
        michaelbusch Michael Busch added a comment -

        Patch including testcase showing the bug.

        Show
        michaelbusch Michael Busch added a comment - Patch including testcase showing the bug.
        Hide
        michaelbusch Michael Busch added a comment -

        Committed.

        Show
        michaelbusch Michael Busch added a comment - Committed.

          People

          • Assignee:
            michaelbusch Michael Busch
            Reporter:
            michaelbusch Michael Busch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development