fix small problems with term vectors

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/realtime_search@1073415 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Busch 2011-02-22 17:14:57 +00:00
parent 6b9c787a9b
commit 541a7263fa
2 changed files with 2 additions and 3 deletions

View File

@ -94,7 +94,6 @@ final class TermVectorsTermsWriter extends TermsHashConsumer {
// vector output files, we must abort this segment
// because those files will be in an unknown
// state:
hasVectors = true;
tvx = docWriter.directory.createOutput(IndexFileNames.segmentFileName(docWriter.getSegment(), "", IndexFileNames.VECTORS_INDEX_EXTENSION));
tvd = docWriter.directory.createOutput(IndexFileNames.segmentFileName(docWriter.getSegment(), "", IndexFileNames.VECTORS_DOCUMENTS_EXTENSION));
tvf = docWriter.directory.createOutput(IndexFileNames.segmentFileName(docWriter.getSegment(), "", IndexFileNames.VECTORS_FIELDS_EXTENSION));
@ -112,7 +111,7 @@ final class TermVectorsTermsWriter extends TermsHashConsumer {
assert docWriter.writer.testPoint("TermVectorsTermsWriter.finishDocument start");
if (numVectorFields == 0) {
if (!hasVectors) {
return;
}
@ -201,7 +200,6 @@ final class TermVectorsTermsWriter extends TermsHashConsumer {
@Override
void startDocument() throws IOException {
assert clearLastVectorFieldName();
perFields = new TermVectorsTermsWriterPerField[1];
reset();
}

View File

@ -70,6 +70,7 @@ final class TermVectorsTermsWriterPerField extends TermsHashConsumerPerField {
}
if (doVectors) {
termsWriter.hasVectors = true;
if (termsWriter.tvx != null) {
if (termsHashPerField.bytesHash.size() != 0) {
// Only necessary if previous doc hit a