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
|
||||
public BytesRef next() throws IOException {
|
||||
if (termsEnum != null) {
|
||||
BytesRef next = termsEnum.next();
|
||||
if (next != null && isFrequent(termsEnum.docFreq())) {
|
||||
BytesRef next;
|
||||
while ((next = termsEnum.next()) != null) {
|
||||
if (isFrequent(termsEnum.docFreq())) {
|
||||
spare.copyBytes(next);
|
||||
return spare;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue