From 60fbae60caa582a1691d270dd11fad44b6787630 Mon Sep 17 00:00:00 2001 From: "Yuan,Xiao" Date: Sun, 8 Oct 2023 22:28:29 -0700 Subject: [PATCH] Explicitly return needStats flag in TermStates --- lucene/core/src/java/org/apache/lucene/index/TermStates.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lucene/core/src/java/org/apache/lucene/index/TermStates.java b/lucene/core/src/java/org/apache/lucene/index/TermStates.java index 75c64a907b1..6b07d8c797d 100644 --- a/lucene/core/src/java/org/apache/lucene/index/TermStates.java +++ b/lucene/core/src/java/org/apache/lucene/index/TermStates.java @@ -204,6 +204,11 @@ public final class TermStates { return docFreq; } + /** Explicitly return needStats flag */ + public boolean hasStats() { + return term == null; + } + /** * Returns the accumulated term frequency of all {@link TermState} instances passed to {@link * #register(TermState, int, int, long)}.