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

DirectoryReader ignores NRT SegmentInfos in #isOptimized()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1, 4.0-ALPHA
    • 3.1, 4.0-ALPHA
    • core/search
    • None
    • 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
          0.6 kB
          Simon Willnauer
        2. LUCENE-2802.patch
          5 kB
          Simon Willnauer
        3. LUCENE-2802.patch
          4 kB
          Simon Willnauer

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: