@@ -78,15 +78,9 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
78
78
private static final ParseField ANALYZER_FIELD = new ParseField ("analyzer" );
79
79
private static final ParseField QUOTE_ANALYZER_FIELD = new ParseField ("quote_analyzer" );
80
80
private static final ParseField ALLOW_LEADING_WILDCARD_FIELD = new ParseField ("allow_leading_wildcard" );
81
- private static final ParseField AUTO_GENERATE_PHRASE_QUERIES_FIELD = new ParseField ("auto_generate_phrase_queries" )
82
- .withAllDeprecated ("This setting is ignored, use [type=phrase] instead" );
83
81
private static final ParseField MAX_DETERMINIZED_STATES_FIELD = new ParseField ("max_determinized_states" );
84
- private static final ParseField LOWERCASE_EXPANDED_TERMS_FIELD = new ParseField ("lowercase_expanded_terms" )
85
- .withAllDeprecated ("Decision is now made by the analyzer" );
86
82
private static final ParseField ENABLE_POSITION_INCREMENTS_FIELD = new ParseField ("enable_position_increments" );
87
83
private static final ParseField ESCAPE_FIELD = new ParseField ("escape" );
88
- private static final ParseField USE_DIS_MAX_FIELD = new ParseField ("use_dis_max" )
89
- .withAllDeprecated ("Set [tie_breaker] to 1 instead" );
90
84
private static final ParseField FUZZY_PREFIX_LENGTH_FIELD = new ParseField ("fuzzy_prefix_length" );
91
85
private static final ParseField FUZZY_MAX_EXPANSIONS_FIELD = new ParseField ("fuzzy_max_expansions" );
92
86
private static final ParseField FUZZY_REWRITE_FIELD = new ParseField ("fuzzy_rewrite" );
@@ -97,13 +91,7 @@ public class QueryStringQueryBuilder extends AbstractQueryBuilder<QueryStringQue
97
91
private static final ParseField MINIMUM_SHOULD_MATCH_FIELD = new ParseField ("minimum_should_match" );
98
92
private static final ParseField QUOTE_FIELD_SUFFIX_FIELD = new ParseField ("quote_field_suffix" );
99
93
private static final ParseField LENIENT_FIELD = new ParseField ("lenient" );
100
- private static final ParseField LOCALE_FIELD = new ParseField ("locale" )
101
- .withAllDeprecated ("Decision is now made by the analyzer" );
102
94
private static final ParseField TIME_ZONE_FIELD = new ParseField ("time_zone" );
103
- private static final ParseField SPLIT_ON_WHITESPACE = new ParseField ("split_on_whitespace" )
104
- .withAllDeprecated ("This setting is ignored, the parser always splits on operator" );
105
- private static final ParseField ALL_FIELDS_FIELD = new ParseField ("all_fields" )
106
- .withAllDeprecated ("Set [default_field] to `*` instead" );
107
95
private static final ParseField TYPE_FIELD = new ParseField ("type" );
108
96
private static final ParseField GENERATE_SYNONYMS_PHRASE_QUERY = new ParseField ("auto_generate_synonyms_phrase_query" );
109
97
private static final ParseField FUZZY_TRANSPOSITIONS_FIELD = new ParseField ("fuzzy_transpositions" );
@@ -193,13 +181,7 @@ public QueryStringQueryBuilder(StreamInput in) throws IOException {
193
181
}
194
182
allowLeadingWildcard = in .readOptionalBoolean ();
195
183
analyzeWildcard = in .readOptionalBoolean ();
196
- if (in .getVersion ().before (Version .V_5_1_1 )) {
197
- in .readBoolean (); // lowercase_expanded_terms
198
- }
199
184
enablePositionIncrements = in .readBoolean ();
200
- if (in .getVersion ().before (Version .V_5_1_1 )) {
201
- in .readString (); // locale
202
- }
203
185
fuzziness = new Fuzziness (in );
204
186
fuzzyPrefixLength = in .readVInt ();
205
187
fuzzyMaxExpansions = in .readVInt ();
@@ -219,13 +201,11 @@ public QueryStringQueryBuilder(StreamInput in) throws IOException {
219
201
timeZone = in .readOptionalTimeZone ();
220
202
escape = in .readBoolean ();
221
203
maxDeterminizedStates = in .readVInt ();
222
- if (in .getVersion ().onOrAfter (Version .V_5_1_1 )) {
223
- if (in .getVersion ().before (Version .V_6_0_0_beta1 )) {
224
- in .readBoolean (); // split_on_whitespace
225
- Boolean useAllField = in .readOptionalBoolean ();
226
- if (useAllField != null && useAllField ) {
227
- defaultField = "*" ;
228
- }
204
+ if (in .getVersion ().onOrAfter (Version .V_5_1_1 ) && in .getVersion ().before (Version .V_6_0_0_beta1 )) {
205
+ in .readBoolean (); // split_on_whitespace
206
+ Boolean useAllField = in .readOptionalBoolean ();
207
+ if (useAllField != null && useAllField ) {
208
+ defaultField = "*" ;
229
209
}
230
210
}
231
211
if (in .getVersion ().onOrAfter (Version .V_6_1_0 )) {
@@ -252,13 +232,7 @@ protected void doWriteTo(StreamOutput out) throws IOException {
252
232
}
253
233
out .writeOptionalBoolean (this .allowLeadingWildcard );
254
234
out .writeOptionalBoolean (this .analyzeWildcard );
255
- if (out .getVersion ().before (Version .V_5_1_1 )) {
256
- out .writeBoolean (true ); // lowercase_expanded_terms
257
- }
258
235
out .writeBoolean (this .enablePositionIncrements );
259
- if (out .getVersion ().before (Version .V_5_1_1 )) {
260
- out .writeString (Locale .ROOT .toLanguageTag ()); // locale
261
- }
262
236
this .fuzziness .writeTo (out );
263
237
out .writeVInt (this .fuzzyPrefixLength );
264
238
out .writeVInt (this .fuzzyMaxExpansions );
@@ -277,12 +251,10 @@ protected void doWriteTo(StreamOutput out) throws IOException {
277
251
out .writeOptionalTimeZone (timeZone );
278
252
out .writeBoolean (this .escape );
279
253
out .writeVInt (this .maxDeterminizedStates );
280
- if (out .getVersion ().onOrAfter (Version .V_5_1_1 )) {
281
- if (out .getVersion ().before (Version .V_6_0_0_beta1 )) {
282
- out .writeBoolean (false ); // split_on_whitespace
283
- Boolean useAllFields = defaultField == null ? null : Regex .isMatchAllPattern (defaultField );
284
- out .writeOptionalBoolean (useAllFields );
285
- }
254
+ if (out .getVersion ().onOrAfter (Version .V_5_1_1 ) && out .getVersion ().before (Version .V_6_0_0_beta1 )) {
255
+ out .writeBoolean (false ); // split_on_whitespace
256
+ Boolean useAllFields = defaultField == null ? null : Regex .isMatchAllPattern (defaultField );
257
+ out .writeOptionalBoolean (useAllFields );
286
258
}
287
259
if (out .getVersion ().onOrAfter (Version .V_6_1_0 )) {
288
260
out .writeBoolean (autoGenerateSynonymsPhraseQuery );
@@ -824,8 +796,6 @@ public static QueryStringQueryBuilder fromXContent(XContentParser parser) throws
824
796
quoteFieldSuffix = parser .textOrNull ();
825
797
} else if (LENIENT_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
826
798
lenient = parser .booleanValue ();
827
- } else if (ALL_FIELDS_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
828
- defaultField = "*" ;
829
799
} else if (MAX_DETERMINIZED_STATES_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
830
800
maxDeterminizedStates = parser .intValue ();
831
801
} else if (TIME_ZONE_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
@@ -841,16 +811,6 @@ public static QueryStringQueryBuilder fromXContent(XContentParser parser) throws
841
811
autoGenerateSynonymsPhraseQuery = parser .booleanValue ();
842
812
} else if (FUZZY_TRANSPOSITIONS_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
843
813
fuzzyTranspositions = parser .booleanValue ();
844
- } else if (AUTO_GENERATE_PHRASE_QUERIES_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
845
- // ignore, deprecated setting
846
- } else if (LOWERCASE_EXPANDED_TERMS_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
847
- // ignore, deprecated setting
848
- } else if (LOCALE_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
849
- // ignore, deprecated setting
850
- } else if (USE_DIS_MAX_FIELD .match (currentFieldName , parser .getDeprecationHandler ())) {
851
- // ignore, deprecated setting
852
- } else if (SPLIT_ON_WHITESPACE .match (currentFieldName , parser .getDeprecationHandler ())) {
853
- // ignore, deprecated setting
854
814
} else {
855
815
throw new ParsingException (parser .getTokenLocation (), "[" + QueryStringQueryBuilder .NAME +
856
816
"] query does not support [" + currentFieldName + "]" );
0 commit comments