Skip to content

Apache Lucene open-source search software

LUCENE-10477: mention 'call multiple times' in Query.rewrite javadoc (#758)

Christine Poerschke779c332a8c76
diff --git a/lucene/core/src/java/org/apache/lucene/search/Query.java b/lucene/core/src/java/org/apache/lucene/search/Query.java
index c41caf251e5..4f04728395d 100644
--- a/lucene/core/src/java/org/apache/lucene/search/Query.java
+++ b/lucene/core/src/java/org/apache/lucene/search/Query.java
@@ -73,6 +73,11 @@ public abstract class Query {
/**
* Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be
* rewritten into a BooleanQuery that consists of TermQuerys.
+ *
+ * <p>Callers are expected to call <code>rewrite</code> multiple times if necessary, until the
+ * rewritten query is the same as the original query.
+ *
+ * @see IndexSearcher#rewrite(Query)
*/
public Query rewrite(IndexReader reader) throws IOException {
return this;