Skip to content

Commit

Permalink
LUCENE-10431: Remove MultiTermQuery.setRewriteMethod() (apache#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
romseygeek authored and dantuzi committed Mar 10, 2022
1 parent 89de1ce commit 7dc57fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ API Changes
* LUCENE-10440: TaxonomyFacets and FloatTaxonomyFacets have been made pkg-private and only serve
as internal implementation details of taxonomy-faceting. (Greg Miller)

* LUCENE-10431: MultiTermQuery.setRewriteMethod() has been removed. (Alan Woodward)

New Features
---------------------

Expand Down
14 changes: 2 additions & 12 deletions lucene/core/src/java/org/apache/lucene/search/MultiTermQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
*/
public abstract class MultiTermQuery extends Query {
protected final String field;
protected RewriteMethod rewriteMethod; // TODO make this final
protected final RewriteMethod rewriteMethod;

/** Abstract class that defines how the query is rewritten. */
public abstract static class RewriteMethod {
Expand Down Expand Up @@ -283,21 +283,11 @@ public final Query rewrite(IndexReader reader) throws IOException {
return rewriteMethod.rewrite(reader, this);
}

/** @return the rewrite method used to build the final query */
public RewriteMethod getRewriteMethod() {
return rewriteMethod;
}

/**
* Sets the rewrite method to be used when executing the query. You can use one of the four core
* methods, or implement your own subclass of {@link RewriteMethod}.
*
* @deprecated set this using a constructor instead
*/
@Deprecated
public void setRewriteMethod(RewriteMethod method) {
rewriteMethod = method;
}

@Override
public int hashCode() {
final int prime = 31;
Expand Down

0 comments on commit 7dc57fd

Please sign in to comment.