mirror of https://github.com/apache/lucene.git
LUCENE-5611: always call PerField.finish even on non-aborting exc
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1591399 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc0d7bbb25
commit
0a83273dfa
|
@ -23,10 +23,6 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.lucene.analysis.TokenStream;
|
import org.apache.lucene.analysis.TokenStream;
|
||||||
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
|
|
||||||
import org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
|
|
||||||
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
|
|
||||||
import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
|
|
||||||
import org.apache.lucene.codecs.DocValuesConsumer;
|
import org.apache.lucene.codecs.DocValuesConsumer;
|
||||||
import org.apache.lucene.codecs.DocValuesFormat;
|
import org.apache.lucene.codecs.DocValuesFormat;
|
||||||
import org.apache.lucene.codecs.FieldInfosWriter;
|
import org.apache.lucene.codecs.FieldInfosWriter;
|
||||||
|
@ -265,21 +261,23 @@ final class DefaultIndexingChain extends DocConsumer {
|
||||||
termsHash.startDocument();
|
termsHash.startDocument();
|
||||||
|
|
||||||
// Invert indexed fields:
|
// Invert indexed fields:
|
||||||
for (IndexableField field : docState.doc.indexableFields()) {
|
try {
|
||||||
IndexableFieldType fieldType = field.fieldType();
|
for (IndexableField field : docState.doc.indexableFields()) {
|
||||||
PerField fp = getOrAddField(field.name(), fieldType, true);
|
IndexableFieldType fieldType = field.fieldType();
|
||||||
boolean first = fp.fieldGen != fieldGen;
|
PerField fp = getOrAddField(field.name(), fieldType, true);
|
||||||
fp.invert(field, first);
|
boolean first = fp.fieldGen != fieldGen;
|
||||||
|
fp.invert(field, first);
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
fields[fieldCount++] = fp;
|
fields[fieldCount++] = fp;
|
||||||
fp.fieldGen = fieldGen;
|
fp.fieldGen = fieldGen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
// Finish each field name seen in the document:
|
||||||
|
for (int i=0;i<fieldCount;i++) {
|
||||||
|
fields[i].finish();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Finish each field name seen in the document:
|
|
||||||
for (int i=0;i<fieldCount;i++) {
|
|
||||||
fields[i].finish();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
|
Loading…
Reference in New Issue