mirror of https://github.com/apache/lucene.git
LUCENE-3807: consume all terms from the enum
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291506 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9d210b0c37
commit
70501dd845
|
@ -91,12 +91,14 @@ public class HighFrequencyDictionary implements Dictionary {
|
||||||
@Override
|
@Override
|
||||||
public BytesRef next() throws IOException {
|
public BytesRef next() throws IOException {
|
||||||
if (termsEnum != null) {
|
if (termsEnum != null) {
|
||||||
BytesRef next = termsEnum.next();
|
BytesRef next;
|
||||||
if (next != null && isFrequent(termsEnum.docFreq())) {
|
while ((next = termsEnum.next()) != null) {
|
||||||
|
if (isFrequent(termsEnum.docFreq())) {
|
||||||
spare.copyBytes(next);
|
spare.copyBytes(next);
|
||||||
return spare;
|
return spare;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue