Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUCENE-10431: Remove MultiTermQuery.setRewriteMethod() #726

Merged
merged 1 commit into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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