Remove deprecated methods in SimpleQueryStringBuilder (#36341)

The `useAllFields`methods have already been deprecated in 6.0 and are save to remove in 7.0.
This commit is contained in:
Christoph Büscher 2018-12-07 11:15:16 +01:00 committed by GitHub
parent 562479b5a5
commit 879397df70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 18 deletions

View File

@ -38,7 +38,6 @@ import org.elasticsearch.index.search.SimpleQueryStringQueryParser.Settings;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@ -251,22 +250,6 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder<SimpleQuerySt
return this.analyzer;
}
@Deprecated
public Boolean useAllFields() {
return fieldsAndWeights.size() == 1 && fieldsAndWeights.keySet().stream().anyMatch(Regex::isMatchAllPattern);
}
/**
* This setting is deprecated, set {@link #field(String)} to "*" instead.
*/
@Deprecated
public SimpleQueryStringBuilder useAllFields(Boolean useAllFields) {
if (useAllFields != null && useAllFields) {
this.fieldsAndWeights = Collections.singletonMap("*", 1.0f);
}
return this;
}
/**
* Specify the default operator for the query. Defaults to "OR" if no
* operator is specified.

View File

@ -594,7 +594,7 @@ public class SimpleQueryStringIT extends ESIntegTestCase {
Exception e = expectThrows(Exception.class, () -> {
SimpleQueryStringBuilder qb = simpleQueryStringQuery("bar");
if (randomBoolean()) {
qb.useAllFields(true);
qb.field("*");
}
client().prepareSearch("toomanyfields").setQuery(qb).get();
});