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

IW.addIndexes(IndexReader...) -> IW.addIndexes(LeafReader...)

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0, 6.0
    • None
    • None
    • New

    Description

      addIndexes(IndexReader...) is useful to force a single merge that transforms data: you wrap the readers with some logic that alters them.

      But for any use case doing this, they need to work on leaves (LeafReader) to actually do anything.

      Otherwise, for simply merging indexes, allowing addIndexes(IndexReader) is unnecessary and maybe a slight trap, its way faster to call addIndexes(Directory), and it won't force a single slow merge, but will just copy in the relevant files and call maybeMerge().

      Part of the confusion is the two methods have such different behavior that i don't think they should be both be named addIndexes. But lets do that separately, first i want to fix the parameters.

      Long term taking LeafReader here is a simple step towards a more performant api for "merging with filterreader", since its horribly inefficient today.

      Attachments

        1. LUCENE-6158.patch
          40 kB
          Robert Muir

        Activity

          People

            Unassigned Unassigned
            rcmuir Robert Muir
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: