Only load term statistics if required
This commit is contained in:
parent
cbcc553912
commit
6b40169b59
|
@ -92,7 +92,6 @@ final class TermVectorsWriter {
|
||||||
final boolean useDocsAndPos = positions || offsets || payloads;
|
final boolean useDocsAndPos = positions || offsets || payloads;
|
||||||
while (iterator.next() != null) { // iterate all terms of the current field
|
while (iterator.next() != null) { // iterate all terms of the current field
|
||||||
BytesRef termBytesRef = iterator.term();
|
BytesRef termBytesRef = iterator.term();
|
||||||
boolean foundTerm = topLevelIterator.seekExact(termBytesRef);
|
|
||||||
Term term = new Term(field, termBytesRef);
|
Term term = new Term(field, termBytesRef);
|
||||||
|
|
||||||
// with filtering we only keep the best terms
|
// with filtering we only keep the best terms
|
||||||
|
@ -107,6 +106,7 @@ final class TermVectorsWriter {
|
||||||
final TermStatistics statistics = dfs.termStatistics().get(term);
|
final TermStatistics statistics = dfs.termStatistics().get(term);
|
||||||
writeTermStatistics(statistics == null ? new TermStatistics(termBytesRef, 0, 0) : statistics);
|
writeTermStatistics(statistics == null ? new TermStatistics(termBytesRef, 0, 0) : statistics);
|
||||||
} else {
|
} else {
|
||||||
|
boolean foundTerm = topLevelIterator.seekExact(termBytesRef);
|
||||||
if (foundTerm) {
|
if (foundTerm) {
|
||||||
writeTermStatistics(topLevelIterator);
|
writeTermStatistics(topLevelIterator);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue