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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      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.

        Activity

        Hide
        jpountz Adrien Grand added a comment -

        +1

        Also big +1 to changing the method name. For a very long time, I have thought that adding readers instead of directories would be faster since the readers would already be open.

        Show
        jpountz Adrien Grand added a comment - +1 Also big +1 to changing the method name. For a very long time, I have thought that adding readers instead of directories would be faster since the readers would already be open.
        Hide
        thetaphi Uwe Schindler added a comment -

        Yes changing the method name would be a good idea.

        Otherwise I dont have a strong opinion on that one.

        Show
        thetaphi Uwe Schindler added a comment - Yes changing the method name would be a good idea. Otherwise I dont have a strong opinion on that one.
        Hide
        rcmuir Robert Muir added a comment -

        I'd really like to defer that to another jira issue and get this change in by itself.

        Show
        rcmuir Robert Muir added a comment - I'd really like to defer that to another jira issue and get this change in by itself.
        Hide
        mikemccand Michael McCandless added a comment -

        +1

        Show
        mikemccand Michael McCandless added a comment - +1
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1649989 from Robert Muir in branch 'dev/trunk'
        [ https://svn.apache.org/r1649989 ]

        LUCENE-6158: IW.addIndexes(IndexReader...) -> IW.addIndexes(LeafReader...)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1649989 from Robert Muir in branch 'dev/trunk' [ https://svn.apache.org/r1649989 ] LUCENE-6158 : IW.addIndexes(IndexReader...) -> IW.addIndexes(LeafReader...)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1649991 from Robert Muir in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1649991 ]

        LUCENE-6158: IW.addIndexes(IndexReader...) -> IW.addIndexes(LeafReader...)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1649991 from Robert Muir in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1649991 ] LUCENE-6158 : IW.addIndexes(IndexReader...) -> IW.addIndexes(LeafReader...)
        Hide
        anshumg Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        anshumg Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development