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

IndexModifier does not support all APIs from IndexWriter/IndexReader

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9, 2.0.0, 2.1
    • Fix Version/s: None
    • Component/s: core/index
    • Labels:
      None
    • Environment:

      n/a

    • Lucene Fields:
      New

      Description

      IndexModifer should probably provide all of the methods defined in both IndexReader and IndexWriter. Currently it does not (e.g., IndexReader.maxDoc() is not available).

      One way to do this might be to have IndexReader and IndexWriter interfaces. For example:

      package org.apache.lucene.index.interface;

      public interface IndexReader {
      ...
      int maxDoc();
      ...
      }

      Then the IndexReader and IndexWriter classes could implement those interfaces:

      package org.apache.lucene.index;

      public abstract class IndexReader implements org.apache.lucene.index.interface IndexReader {
      ...
      public int maxDoc()

      { ... }
      ...
      }

      The IndexModifier could then implement both:

      public class IndexModifier implements org.apache.lucene.index.interface IndexReader,
      org.apache.lucene.index.interface IndexWriter {
      ...
      }

      Anywhere an IndexWriter or IndexReader was needed, one would require an object which implemented the appropriate interface:

      package org.apache.lucene.index;

      public class MultiReader extends IndexReader {
      ...
      MultiReader(org.apache.lucene.index.interface.IndexReader[] subReaders) { ... }

      ...
      }

      Just a thought....

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mbogosian Matthew Bogosian
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: