benwtrent commented on code in PR #12197:
URL: https://github.com/apache/lucene/pull/12197#discussion_r1135638431
##########
lucene/core/src/java/org/apache/lucene/search/Query.java:
##########
@@ -77,10 +85,28 @@ public Weight createWeight(IndexSearcher searcher,
ScoreMode scoreMode, float bo
* <p>Callers are expected to call <code>rewrite</code> multiple times if
necessary, until the
* rewritten query is the same as the original query.
*
+ * @deprecated Use {@link Query#rewrite(IndexSearcher)}
* @see IndexSearcher#rewrite(Query)
*/
+ @Deprecated
public Query rewrite(IndexReader reader) throws IOException {
- return this;
+ return isDeprecatedRewriteMethodOverridden ? this : rewrite(new
IndexSearcher(reader));
Review Comment:
I added a comment on the new method notifying callers of this.
--
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]