|
@@ -522,7 +522,7 @@ final class DocumentParser {
|
|
|
// There is a concrete mapper for this field already. Need to check if the mapper
|
|
|
// expects an array, if so we pass the context straight to the mapper and if not
|
|
|
// we serialize the array components
|
|
|
- if (mapper instanceof ArrayValueMapperParser) {
|
|
|
+ if (parsesArrayValue(mapper)) {
|
|
|
parseObjectOrField(context, mapper);
|
|
|
} else {
|
|
|
parseNonDynamicArray(context, parentMapper, lastFieldName, arrayFieldName);
|
|
@@ -543,7 +543,7 @@ final class DocumentParser {
|
|
|
Mapper.BuilderContext builderContext = new Mapper.BuilderContext(context.indexSettings().getSettings(), context.path());
|
|
|
mapper = builder.build(builderContext);
|
|
|
assert mapper != null;
|
|
|
- if (mapper instanceof ArrayValueMapperParser) {
|
|
|
+ if (parsesArrayValue(mapper)) {
|
|
|
context.addDynamicMapper(mapper);
|
|
|
context.path().add(arrayFieldName);
|
|
|
parseObjectOrField(context, mapper);
|
|
@@ -562,6 +562,10 @@ final class DocumentParser {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private static boolean parsesArrayValue(Mapper mapper) {
|
|
|
+ return mapper instanceof FieldMapper && ((FieldMapper) mapper).parsesArrayValue();
|
|
|
+ }
|
|
|
+
|
|
|
private static void parseNonDynamicArray(ParseContext context, ObjectMapper mapper,
|
|
|
final String lastFieldName, String arrayFieldName) throws IOException {
|
|
|
XContentParser parser = context.parser();
|