From e37a04646ae98f3794555349fa90861e9ce47bb8 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Wed, 25 Jan 2006 22:49:45 +0000 Subject: [PATCH] make setMaxBufferedDocs(1) behave correctly git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@372350 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 3 +++ src/java/org/apache/lucene/index/IndexWriter.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 5b149ba7e47..69699abbd8d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -330,6 +330,9 @@ Bug fixes fixed by aquiring the commit lock. (Luc Vanlerberghe via Yonik Seeley, LUCENE-481) +22. IndexWriter.setMaxBufferedDocs(1) didn't have the expected effect, + this has now been fixed. (Daniel Naber) + Optimizations 1. Disk usage (peak requirements during indexing and optimization) diff --git a/src/java/org/apache/lucene/index/IndexWriter.java b/src/java/org/apache/lucene/index/IndexWriter.java index 7a72f2c25fe..7e215a769a2 100644 --- a/src/java/org/apache/lucene/index/IndexWriter.java +++ b/src/java/org/apache/lucene/index/IndexWriter.java @@ -637,7 +637,7 @@ public class IndexWriter { int mergeDocs = 0; while (--minSegment >= 0) { SegmentInfo si = segmentInfos.info(minSegment); - if (si.docCount >= targetMergeDocs) + if (si.docCount > targetMergeDocs) break; mergeDocs += si.docCount; }