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:
parent
562479b5a5
commit
879397df70
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue