@@ -1094,10 +1094,6 @@ else if (!resolversClause.isEmpty())
10941094 if (this .input .model ().attributes ().get (attributeName ) == null )
10951095 continue ;
10961096 String attributeType = this .input .model ().attributes ().get (attributeName ).type ();
1097- if (!docAttributes .containsKey (attributeName ))
1098- docAttributes .put (attributeName , new TreeSet <>());
1099- if (!nextInputAttributes .containsKey (attributeName ))
1100- nextInputAttributes .put (attributeName , new Attribute (attributeName , attributeType ));
11011097
11021098 // Get the attribute values from the doc.
11031099 if (doc .has ("fields" ) && doc .get ("fields" ).has (indexFieldName )) {
@@ -1114,6 +1110,10 @@ else if (!resolversClause.isEmpty())
11141110 if (vNode .isNull () || valueNode .isMissingNode ())
11151111 continue ;
11161112 Value value = Value .create (attributeType , vNode );
1113+ if (!docAttributes .containsKey (attributeName ))
1114+ docAttributes .put (attributeName , new TreeSet <>());
1115+ if (!nextInputAttributes .containsKey (attributeName ))
1116+ nextInputAttributes .put (attributeName , new Attribute (attributeName , attributeType ));
11171117 docAttributes .get (attributeName ).add (value );
11181118 nextInputAttributes .get (attributeName ).values ().add (value );
11191119 }
@@ -1123,6 +1123,10 @@ else if (!resolversClause.isEmpty())
11231123 docIndexFields .put (indexFieldName , valueNode );
11241124 } else {
11251125 Value value = Value .create (attributeType , valueNode );
1126+ if (!docAttributes .containsKey (attributeName ))
1127+ docAttributes .put (attributeName , new TreeSet <>());
1128+ if (!nextInputAttributes .containsKey (attributeName ))
1129+ nextInputAttributes .put (attributeName , new Attribute (attributeName , attributeType ));
11261130 docAttributes .get (attributeName ).add (value );
11271131 nextInputAttributes .get (attributeName ).values ().add (value );
11281132 docIndexFields .put (indexFieldName , valueNode );
@@ -1154,11 +1158,19 @@ else if (!resolversClause.isEmpty())
11541158 if (vNode .isNull () || valueNode .isMissingNode ())
11551159 continue ;
11561160 Value value = Value .create (attributeType , vNode );
1161+ if (!docAttributes .containsKey (attributeName ))
1162+ docAttributes .put (attributeName , new TreeSet <>());
1163+ if (!nextInputAttributes .containsKey (attributeName ))
1164+ nextInputAttributes .put (attributeName , new Attribute (attributeName , attributeType ));
11571165 docAttributes .get (attributeName ).add (value );
11581166 nextInputAttributes .get (attributeName ).values ().add (value );
11591167 }
11601168 } else {
11611169 Value value = Value .create (attributeType , valueNode );
1170+ if (!docAttributes .containsKey (attributeName ))
1171+ docAttributes .put (attributeName , new TreeSet <>());
1172+ if (!nextInputAttributes .containsKey (attributeName ))
1173+ nextInputAttributes .put (attributeName , new Attribute (attributeName , attributeType ));
11621174 docAttributes .get (attributeName ).add (value );
11631175 nextInputAttributes .get (attributeName ).values ().add (value );
11641176 }
0 commit comments