@@ -287,8 +287,18 @@ void shouldWriteMappingForDisabledProperty() {
287
287
}
288
288
289
289
@ Test // #1767
290
- @ DisplayName ("should write dynamic mapping entries" )
291
- void shouldWriteDynamicMappingEntries () {
290
+ @ DisplayName ("should write dynamic mapping annotations" )
291
+ void shouldWriteDynamicMappingAnnotations () {
292
+
293
+ IndexOperations indexOps = operations .indexOps (DynamicMappingAnnotationEntity .class );
294
+ indexOps .create ();
295
+ indexOps .putMapping ();
296
+
297
+ }
298
+
299
+ @ Test // #1871
300
+ @ DisplayName ("should write dynamic mapping" )
301
+ void shouldWriteDynamicMapping () {
292
302
293
303
IndexOperations indexOps = operations .indexOps (DynamicMappingEntity .class );
294
304
indexOps .create ();
@@ -1104,9 +1114,9 @@ public void setDense_vector(@Nullable float[] dense_vector) {
1104
1114
}
1105
1115
}
1106
1116
1107
- @ Document (indexName = "dynamic-mapping" )
1117
+ @ Document (indexName = "dynamic-mapping-annotation " )
1108
1118
@ DynamicMapping (DynamicMappingValue .False )
1109
- static class DynamicMappingEntity {
1119
+ static class DynamicMappingAnnotationEntity {
1110
1120
1111
1121
@ Nullable @ DynamicMapping (DynamicMappingValue .Strict ) @ Field (type = FieldType .Object ) private Author author ;
1112
1122
@ Nullable @ DynamicMapping (DynamicMappingValue .False ) @ Field (
@@ -1124,6 +1134,31 @@ public void setAuthor(Author author) {
1124
1134
}
1125
1135
}
1126
1136
1137
+ @ Document (indexName = "dynamic-mapping" , dynamic = Dynamic .FALSE )
1138
+ static class DynamicMappingEntity {
1139
+
1140
+ @ Nullable @ Field (type = FieldType .Object ) //
1141
+ private Map <String , Object > objectInherit ;
1142
+ @ Nullable @ Field (type = FieldType .Object , dynamic = Dynamic .FALSE ) //
1143
+ private Map <String , Object > objectFalse ;
1144
+ @ Nullable @ Field (type = FieldType .Object , dynamic = Dynamic .TRUE ) //
1145
+ private Map <String , Object > objectTrue ;
1146
+ @ Nullable @ Field (type = FieldType .Object , dynamic = Dynamic .STRICT ) //
1147
+ private Map <String , Object > objectStrict ;
1148
+ @ Nullable @ Field (type = FieldType .Object , dynamic = Dynamic .RUNTIME ) //
1149
+ private Map <String , Object > objectRuntime ;
1150
+ @ Nullable @ Field (type = FieldType .Nested ) //
1151
+ private List <Map <String , Object >> nestedObjectInherit ;
1152
+ @ Nullable @ Field (type = FieldType .Nested , dynamic = Dynamic .FALSE ) //
1153
+ private List <Map <String , Object >> nestedObjectFalse ;
1154
+ @ Nullable @ Field (type = FieldType .Nested , dynamic = Dynamic .TRUE ) //
1155
+ private List <Map <String , Object >> nestedObjectTrue ;
1156
+ @ Nullable @ Field (type = FieldType .Nested , dynamic = Dynamic .STRICT ) //
1157
+ private List <Map <String , Object >> nestedObjectStrict ;
1158
+ @ Nullable @ Field (type = FieldType .Nested , dynamic = Dynamic .RUNTIME ) //
1159
+ private List <Map <String , Object >> nestedObjectRuntime ;
1160
+ }
1161
+
1127
1162
@ Document (indexName = "dynamic-detection-mapping-true" )
1128
1163
@ Mapping (dateDetection = Mapping .Detection .TRUE , numericDetection = Mapping .Detection .TRUE ,
1129
1164
dynamicDateFormats = { "MM/dd/yyyy" })
0 commit comments