fix MTQ.CutOffTermCollector to check limits after adding term, not before

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1025929 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-10-21 10:22:58 +00:00
parent f6558c7ed0
commit b0f24be337
1 changed files with 2 additions and 2 deletions

View File

@ -759,12 +759,12 @@ public abstract class MultiTermQuery extends Query {
@Override
public boolean collect(BytesRef bytes) throws IOException {
pendingTerms.add(bytes);
docVisitCount += termsEnum.docFreq();
if (pendingTerms.size() >= termCountLimit || docVisitCount >= docCountCutoff) {
hasCutOff = true;
return false;
}
pendingTerms.add(bytes);
docVisitCount += termsEnum.docFreq();
return true;
}