Skip to content

Commit b9273d8

Browse files
committed
Remove deprecated query name in short version of regexp query
1 parent bb90b89 commit b9273d8

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

core/src/main/java/org/elasticsearch/index/query/RegexpQueryBuilder.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public class RegexpQueryBuilder extends AbstractQueryBuilder<RegexpQueryBuilder>
4747
public static final int DEFAULT_FLAGS_VALUE = RegexpFlag.ALL.value();
4848
public static final int DEFAULT_MAX_DETERMINIZED_STATES = Operations.DEFAULT_MAX_DETERMINIZED_STATES;
4949

50-
private static final ParseField NAME_FIELD = new ParseField("_name")
51-
.withAllDeprecated("query name is not supported in short version of regexp query");
5250
private static final ParseField FLAGS_VALUE_FIELD = new ParseField("flags_value");
5351
private static final ParseField MAX_DETERMINIZED_STATES_FIELD = new ParseField("max_determinized_states");
5452
private static final ParseField FLAGS_FIELD = new ParseField("flags");
@@ -219,13 +217,9 @@ public static RegexpQueryBuilder fromXContent(XContentParser parser) throws IOEx
219217
}
220218
}
221219
} else {
222-
if (NAME_FIELD.match(currentFieldName)) {
223-
queryName = parser.text();
224-
} else {
225-
throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName());
226-
fieldName = currentFieldName;
227-
value = parser.textOrNull();
228-
}
220+
throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName());
221+
fieldName = currentFieldName;
222+
value = parser.textOrNull();
229223
}
230224
}
231225

0 commit comments

Comments
 (0)