Skip to content

Apache Lucene open-source search software

Deprecate TermInSetQuery#getTermData (#12173)

Greg Millerc8741f7c586b
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index dc7ffdcb265..6650543ea8d 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -112,6 +112,9 @@ API Changes
* GITHUB#12129: Move DocValuesTermsQuery from sandbox to SortedDocValuesField#newSlowSetQuery
and SortedSetDocValuesField#newSlowSetQuery. (Robert Muir)
+* GITHUB#12173: TermInSetQuery#getTermData has been deprecated. This exposes internal implementation details that we
+ may want to change in the future, and users shouldn't rely on the encoding directly. (Greg Miller)
+
New Features
---------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java b/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java
index 9d482369975..ecffb438112 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java
@@ -178,7 +178,13 @@ public class TermInSetQuery extends MultiTermQuery implements Accountable {
return 31 * classHash() + termDataHashCode;
}
- /** Returns the terms wrapped in a PrefixCodedTerms. */
+ /**
+ * Returns the terms wrapped in a PrefixCodedTerms.
+ *
+ * @deprecated the encoded terms will no longer be exposed in a future major version; this is an
+ * implementation detail that could change at some point and shouldn't be relied on directly
+ */
+ @Deprecated
public PrefixCodedTerms getTermData() {
return termData;
}