LUCENE-3708: always call postingswriter.finishDoc when writing postings

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1233405 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-01-19 14:38:34 +00:00
parent 5bc7f5bbd0
commit 3c6d62edbb
2 changed files with 3 additions and 7 deletions

View File

@ -33,9 +33,7 @@ import org.apache.lucene.util.FixedBitSet;
public abstract class PostingsConsumer {
/** Adds a new doc in this term. If this field omits term
* freqs & positions then termDocFreq should be ignored,
* and, finishDoc will not be called. */
/** Adds a new doc in this term. */
public abstract void startDoc(int docID, int termDocFreq) throws IOException;
public static class PostingsMergeState {
@ -52,8 +50,7 @@ public abstract class PostingsConsumer {
public abstract void addPosition(int position, BytesRef payload, int startOffset, int endOffset) throws IOException;
/** Called when we are done adding positions & payloads
* for each doc. Not called when the field omits term
* freq and positions. */
* for each doc. */
public abstract void finishDoc() throws IOException;
/** Default merge impl: append documents, mapping around

View File

@ -517,9 +517,8 @@ final class FreqProxTermsWriterPerField extends TermsHashConsumerPerField implem
}
}
}
postingsConsumer.finishDoc();
}
postingsConsumer.finishDoc();
}
termsConsumer.finishTerm(text, new TermStats(numDocs, totTF));
sumTotalTermFreq += totTF;