Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2858 Separate SegmentReaders (and other atomic readers) from composite IndexReaders
  3. LUCENE-3716

Discussion topic: Move all Commit/Version&Reopen stuff from abstract IR to DirectoryReader


    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 4.0-ALPHA
    • 4.0-ALPHA
    • None
    • None
    • New


      When implementing the parent issue, I noticed a lot of other stuff in IndexReader thats only implemented in DirectoryReader/SegmentReader and is not really related to IndexReader at all:

      • getVersion (maybe also isCurrent) only affects DirectoryReaders, because of the commit-stuff there is no easy way for e.g. MultiReader to implement this
      • reopen/openIfChanged cannot be implemented easily by most AtomicIndexReaders, but also CompositeIndexReader is the wrong place to define those methods
      • all methods returning/opening IndexCommits

      In the parant issue, I already let IndexReader.open() return DirectoryReader and I made this class public. We should move the whole stuff (including IR.open) to DirectoryReader. Reopening outside DirectoryReader is not really needed.

      If some people think, it should maybe stay abstract (affects only the reopen/version stuff), there are ways for other readers to implement it, but for sure its not specific to IR's in general. In that case I would decalre an interface that DirectoryReader implements. Code like SearcherManager/Solr could then instanceof the IR instance and find out if it's worth reopening/version checking).


        Issue Links



              uschindler Uwe Schindler
              uschindler Uwe Schindler
              0 Vote for this issue
              0 Start watching this issue