diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java index c159c823850a8..21a0c4d393a23 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java @@ -1466,7 +1466,7 @@ public static BiConsumer notInMultiFields(String t }; } - public static BiConsumer notDynamicallyCreated(String type) { + public static BiConsumer notFromDynamicTemplates(String type) { return (n, c) -> { if (c.isFromDynamicTemplate()) { throw new MapperParsingException("Field [" + n + "] of type [" + type + "] can't be used in dynamic templates"); diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DynamicFieldMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DynamicFieldMapperTests.java index 19f0bc6d49219..6f47a9be84429 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DynamicFieldMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DynamicFieldMapperTests.java @@ -172,7 +172,7 @@ private static class NonDynamicFieldMapper extends FieldMapper { private static final TypeParser PARSER = new TypeParser( (n, c) -> new Builder(n), - List.of(notDynamicallyCreated(NAME), notInMultiFields(NAME)) + List.of(notFromDynamicTemplates(NAME), notInMultiFields(NAME)) ); private static class Builder extends FieldMapper.Builder {