Remove remains of 'auto_generate_phrase_queries' (#35735)
This parameter in the `query_string` query was deprecated in 6.0 and ignored since then. Its API methods and remaining uses can be removed in the upcoming major version. Relates to #35734
This commit is contained in:
parent
d061b3999a
commit
e91f404d16
|
@ -387,22 +387,6 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This setting is ignored
|
||||
*/
|
||||
@Deprecated
|
||||
public QueryStringQueryBuilder autoGeneratePhraseQueries(boolean autoGeneratePhraseQueries) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This setting is ignored
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean autoGeneratePhraseQueries() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protects against too-difficult regular expression queries.
|
||||
*/
|
||||
|
|
|
@ -127,9 +127,6 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase<QueryStr
|
|||
if (randomBoolean()) {
|
||||
queryStringQueryBuilder.maxDeterminizedStates(randomIntBetween(1, 100));
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
queryStringQueryBuilder.autoGeneratePhraseQueries(randomBoolean());
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
queryStringQueryBuilder.enablePositionIncrements(randomBoolean());
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
package org.elasticsearch.search.fetch.subphase.highlight;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.MockAnalyzer;
|
||||
import org.apache.lucene.analysis.MockTokenizer;
|
||||
|
@ -2589,22 +2590,22 @@ public class HighlighterSearchIT extends ESIntegTestCase {
|
|||
// Query string with a single field
|
||||
phraseBoostTestCaseForClauses(highlighterType, 100f,
|
||||
queryStringQuery("highlight words together").field("field1"),
|
||||
queryStringQuery("\"highlight words together\"").field("field1").autoGeneratePhraseQueries(true));
|
||||
queryStringQuery("\"highlight words together\"").field("field1"));
|
||||
|
||||
// Query string with a single field without dismax
|
||||
phraseBoostTestCaseForClauses(highlighterType, 100f,
|
||||
queryStringQuery("highlight words together").field("field1"),
|
||||
queryStringQuery("\"highlight words together\"").field("field1").autoGeneratePhraseQueries(true));
|
||||
queryStringQuery("\"highlight words together\"").field("field1"));
|
||||
|
||||
// Query string with more than one field
|
||||
phraseBoostTestCaseForClauses(highlighterType, 100f,
|
||||
queryStringQuery("highlight words together").field("field1").field("field2"),
|
||||
queryStringQuery("\"highlight words together\"").field("field1").field("field2").autoGeneratePhraseQueries(true));
|
||||
queryStringQuery("\"highlight words together\"").field("field1").field("field2"));
|
||||
|
||||
// Query string boosting the field
|
||||
phraseBoostTestCaseForClauses(highlighterType, 1f,
|
||||
queryStringQuery("highlight words together").field("field1"),
|
||||
queryStringQuery("\"highlight words together\"").field("field1", 100).autoGeneratePhraseQueries(true));
|
||||
queryStringQuery("\"highlight words together\"").field("field1", 100));
|
||||
}
|
||||
|
||||
private <P extends AbstractQueryBuilder<P>> void
|
||||
|
|
|
@ -33,7 +33,6 @@ public class QueryStringQuery extends LeafQuery {
|
|||
appliers.put("analyzer", (qb, s) -> qb.analyzer(s));
|
||||
appliers.put("quote_analyzer", (qb, s) -> qb.quoteAnalyzer(s));
|
||||
appliers.put("allow_leading_wildcard", (qb, s) -> qb.allowLeadingWildcard(Booleans.parseBoolean(s)));
|
||||
appliers.put("auto_generate_phrase_queries", (qb, s) -> qb.autoGeneratePhraseQueries(Booleans.parseBoolean(s)));
|
||||
appliers.put("max_determinized_states", (qb, s) -> qb.maxDeterminizedStates(Integer.valueOf(s)));
|
||||
appliers.put("lowercase_expanded_terms", (qb, s) -> {});
|
||||
appliers.put("enable_position_increments", (qb, s) -> qb.enablePositionIncrements(Booleans.parseBoolean(s)));
|
||||
|
|
Loading…
Reference in New Issue