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

DirectoryReader ignores NRT SegmentInfos in #isOptimized()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, 4.0-ALPHA
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      DirectoryReader only takes shared (with IW) SegmentInfos into account in DirectoryReader#isOptimized(). This can return true even if the actual realtime reader sees more than one segments.

      public boolean isOptimized() {
          ensureOpen();
         // if segmentsInfos changes in IW this can return false positive
          return segmentInfos.size() == 1 && !hasDeletions();
        }
      

      DirectoryReader should check if this reader has a non-nul segmentInfosStart and use that instead

        Attachments

        1. LUCENE-2802.patch
          4 kB
          Simon Willnauer
        2. LUCENE-2802.patch
          5 kB
          Simon Willnauer
        3. LUCENE-2802.patch
          0.6 kB
          Simon Willnauer

          Issue Links

            Activity

              People

              • Assignee:
                simonw Simon Willnauer
                Reporter:
                simonw Simon Willnauer
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: