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

Allow easy extension of IndexWriter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • core/index
    • None
    • New, Patch Available

    Description

      IndexWriter is not so easy to extend. It hides a lot of useful methods from extending classes as well as useful members (like infoStream). Most of this stuff is very straightforward and I believe it's not exposed for no particular reason. Over in LUCENE-1879 I plan extend IndexWriter to provide a ParallelWriter which will support the parallel indexing requirements. For that I'll need access to several methods and members. I plan to contain in this issue some simple hooks, nothing fancy (and hopefully controversial). I'll leave the rest to specific issues. For now:

      1. Introduce a protected default constructor and init(Directory, IndexWriterConfig). That's required because ParallelWriter does not itself index anything, but instead delegates to its Slices. So that ctor is for convenience only, and I'll make it clear (through javadocs) that if one uses it, one needs to call init(). PQ has the same pattern.
      2. Expose some members and methods that are useful for extensions (such as config, infoStream etc.). Some candidates are package-private methods, but these will be reviewed and converted on a case by case basis.

      I don't plan to do anything drastic here, just prepare IW for easier extendability.

      I'll post a patch after LUCENE-2320 is committed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: