Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lucene/core/src/java/org/apache/lucene/index/TermStates.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ public static TermStates build(IndexSearcher indexSearcher, Term term, boolean n
if (needsStats) {
PendingTermLookup[] pendingTermLookups = new PendingTermLookup[0];
for (LeafReaderContext ctx : context.leaves()) {
Terms terms = Terms.getTerms(ctx.reader(), term.field());
Terms terms = ctx.reader().terms(term.field());
if (terms == null) {
continue;
}
Comment on lines +105 to +107
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we can instead keep the original and check for terms == EMPTY. Although, both read okay to me.

TermsEnum termsEnum = terms.iterator();
// Schedule the I/O in the terms dictionary in the background.
IOBooleanSupplier termExistsSupplier = termsEnum.prepareSeekExact(term.bytes());
Expand Down
Loading