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

IndexWriter.setMaxMergeDocs gives non-backwards-compatible exception "out of the box"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Yonik hit this (see details in LUCENE-994): because we have switched
      to LogByteSizeMergePolicy by default in IndexWriter, which uses MB to
      limit max size of merges (setMaxMergeMB), when an existing app calls
      setMaxMergeDocs (or getMaxMergeDocs) it will hit an
      IllegalArgumentException on dropping in the new JAR.

      I think the simplest solution is to fix LogByteSizeMergePolicy to
      allow setting of the max by either MB or by doc count, just like how
      in LUCENE-1007 allows flushing by either MB or docCount or both.

      1. LUCENE-1013.patch
        8 kB
        Michael McCandless

        Activity

        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        > fix LogByteSizeMergePolicy to allow setting of the max by either MB or by doc count
        +1

        Show
        yseeley@gmail.com Yonik Seeley added a comment - > fix LogByteSizeMergePolicy to allow setting of the max by either MB or by doc count +1
        Hide
        mikemccand Michael McCandless added a comment -

        Attached patch to move setMaxMergeDocs up into LogMergePolicy so that IndexWriter.setMaxMergeDocs(...) works out-of-the-box again. I plan to commit in a few days.

        Show
        mikemccand Michael McCandless added a comment - Attached patch to move setMaxMergeDocs up into LogMergePolicy so that IndexWriter.setMaxMergeDocs(...) works out-of-the-box again. I plan to commit in a few days.
        Hide
        mikemccand Michael McCandless added a comment -

        I just committed this.

        Show
        mikemccand Michael McCandless added a comment - I just committed this.

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            mikemccand Michael McCandless
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development