jainankitk commented on code in PR #15227:
URL: https://github.com/apache/lucene/pull/15227#discussion_r2377149159
##########
lucene/core/src/java/org/apache/lucene/index/TermStates.java:
##########
@@ -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;
+ }
Review Comment:
I am wondering if we can instead keep the original and check for `terms ==
EMPTY`. Although, both read okay to me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]