From 52e9e3dac3f8ef58bd07c3cf7824c907bcd4af89 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Sun, 30 Jul 2006 11:56:57 +0000 Subject: [PATCH] LUCENE-641: fix off-by-one bug for maximum field length git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@426883 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 3 +++ src/java/org/apache/lucene/index/DocumentWriter.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index aba4d76beb1..cde27796fc2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -86,6 +86,9 @@ Bug fixes 11. LUCENE-593: Fixed inner Iterator (Kåre Fiedler Christiansen via Otis Gospodnetic) +12. LUCENE-641: fixed an off-by-one bug with IndexWriter.setMaxFieldLength() + (Daniel Naber) + Optimizations 1. LUCENE-586: TermDocs.skipTo() is now more efficient for multi-segment diff --git a/src/java/org/apache/lucene/index/DocumentWriter.java b/src/java/org/apache/lucene/index/DocumentWriter.java index d2b407e8142..60819ac4334 100644 --- a/src/java/org/apache/lucene/index/DocumentWriter.java +++ b/src/java/org/apache/lucene/index/DocumentWriter.java @@ -171,7 +171,7 @@ final class DocumentWriter { addPosition(fieldName, t.termText(), position++, null); lastToken = t; - if (++length > maxFieldLength) { + if (++length >= maxFieldLength) { if (infoStream != null) infoStream.println("maxFieldLength " +maxFieldLength+ " reached, ignoring following tokens"); break;