LUCENE-1071: Fixed SegmentMerger to correctly set payload bit in the merged segment.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@599264 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Busch 2007-11-29 04:43:03 +00:00
parent 8e79f64fbc
commit 67e0d82230
3 changed files with 7 additions and 1 deletions

View File

@ -169,6 +169,9 @@ Bug fixes
Simple/NativeFSLockFactory if we fail to delete the lock file when Simple/NativeFSLockFactory if we fail to delete the lock file when
releasing the lock. (Nikolay Diakov via Mike McCandless) releasing the lock. (Nikolay Diakov via Mike McCandless)
24. LUCENE-1071: Fixed SegmentMerger to correctly set payload bit in
the merged segment. (Michael Busch)
New features New features
1. LUCENE-906: Elision filter for French. 1. LUCENE-906: Elision filter for French.

View File

@ -221,7 +221,7 @@ final class SegmentMerger {
SegmentReader segmentReader = (SegmentReader) reader; SegmentReader segmentReader = (SegmentReader) reader;
for (int j = 0; j < segmentReader.getFieldInfos().size(); j++) { for (int j = 0; j < segmentReader.getFieldInfos().size(); j++) {
FieldInfo fi = segmentReader.getFieldInfos().fieldInfo(j); FieldInfo fi = segmentReader.getFieldInfos().fieldInfo(j);
fieldInfos.add(fi.name, fi.isIndexed, fi.storeTermVector, fi.storePositionWithTermVector, fi.storeOffsetWithTermVector, !reader.hasNorms(fi.name)); fieldInfos.add(fi.name, fi.isIndexed, fi.storeTermVector, fi.storePositionWithTermVector, fi.storeOffsetWithTermVector, !reader.hasNorms(fi.name), fi.storePayloads);
} }
} else { } else {
addIndexed(reader, fieldInfos, reader.getFieldNames(IndexReader.FieldOption.TERMVECTOR_WITH_POSITION_OFFSET), true, true, true, false); addIndexed(reader, fieldInfos, reader.getFieldNames(IndexReader.FieldOption.TERMVECTOR_WITH_POSITION_OFFSET), true, true, true, false);

View File

@ -197,6 +197,9 @@ public class TestPayloads extends LuceneTestCase {
writer.addDocument(d); writer.addDocument(d);
} }
// make sure we create more than one segment to test merging
writer.flush();
// now we make sure to have different payload lengths next at the next skip point // now we make sure to have different payload lengths next at the next skip point
for (int i = 0; i < numDocs; i++) { for (int i = 0; i < numDocs; i++) {
analyzer.setPayloadData(fieldName, payloadData, offset, i); analyzer.setPayloadData(fieldName, payloadData, offset, i);