@@ -230,8 +230,7 @@ private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentE
230
230
boolean writeNestedProperties = !isRootObject && (isAnyPropertyAnnotatedWithField (entity ) || nestedOrObjectField );
231
231
if (writeNestedProperties ) {
232
232
233
- String type = nestedOrObjectField ? fieldType .toString ().toLowerCase ()
234
- : FieldType .Object .toString ().toLowerCase ();
233
+ String type = nestedOrObjectField ? fieldType .getMappedName () : FieldType .Object .getMappedName ();
235
234
236
235
ObjectNode nestedObjectNode = objectMapper .createObjectNode ();
237
236
nestedObjectNode .put (FIELD_PARAM_TYPE , type );
@@ -247,9 +246,9 @@ private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentE
247
246
}
248
247
249
248
if (entity != null && entity .dynamic () != Dynamic .INHERIT ) {
250
- objectNode .put (TYPE_DYNAMIC , entity .dynamic ().name (). toLowerCase ());
249
+ objectNode .put (TYPE_DYNAMIC , entity .dynamic ().getMappedName ());
251
250
} else if (dynamicMapping != null ) {
252
- objectNode .put (TYPE_DYNAMIC , dynamicMapping .value ().name (). toLowerCase ());
251
+ objectNode .put (TYPE_DYNAMIC , dynamicMapping .value ().getMappedName ());
253
252
}
254
253
255
254
ObjectNode propertiesNode = objectNode .putObject (FIELD_PROPERTIES );
@@ -418,7 +417,7 @@ private void applyCompletionFieldMapping(ObjectNode propertyNode, ElasticsearchP
418
417
419
418
ObjectNode contextNode = contextsNode .addObject ();
420
419
contextNode .put (FIELD_CONTEXT_NAME , context .name ());
421
- contextNode .put (FIELD_CONTEXT_TYPE , context .type ().name (). toLowerCase ());
420
+ contextNode .put (FIELD_CONTEXT_TYPE , context .type ().getMappedName ());
422
421
423
422
if (context .precision ().length () > 0 ) {
424
423
contextNode .put (FIELD_CONTEXT_PRECISION , context .precision ());
@@ -450,7 +449,7 @@ private void applyDisabledPropertyMapping(ObjectNode propertiesNode, Elasticsear
450
449
}
451
450
452
451
propertiesNode .set (property .getFieldName (), objectMapper .createObjectNode () //
453
- .put (FIELD_PARAM_TYPE , field .type ().name (). toLowerCase ()) //
452
+ .put (FIELD_PARAM_TYPE , field .type ().getMappedName ()) //
454
453
.put (MAPPING_ENABLED , false ) //
455
454
);
456
455
@@ -479,9 +478,9 @@ private void addSingleFieldMapping(ObjectNode propertiesNode, ElasticsearchPersi
479
478
480
479
if (nestedOrObjectField ) {
481
480
if (annotation .dynamic () != Dynamic .INHERIT ) {
482
- fieldNode .put (TYPE_DYNAMIC , annotation .dynamic ().name (). toLowerCase ());
481
+ fieldNode .put (TYPE_DYNAMIC , annotation .dynamic ().getMappedName ());
483
482
} else if (dynamicMapping != null ) {
484
- fieldNode .put (TYPE_DYNAMIC , dynamicMapping .value ().name (). toLowerCase ());
483
+ fieldNode .put (TYPE_DYNAMIC , dynamicMapping .value ().getMappedName ());
485
484
}
486
485
}
487
486
}
@@ -530,9 +529,9 @@ private void addMultiFieldMapping(ObjectNode propertyNode, ElasticsearchPersiste
530
529
531
530
if (nestedOrObjectField ) {
532
531
if (annotation .mainField ().dynamic () != Dynamic .INHERIT ) {
533
- mainFieldNode .put (TYPE_DYNAMIC , annotation .mainField ().dynamic ().name (). toLowerCase ());
532
+ mainFieldNode .put (TYPE_DYNAMIC , annotation .mainField ().dynamic ().getMappedName ());
534
533
} else if (dynamicMapping != null ) {
535
- mainFieldNode .put (TYPE_DYNAMIC , dynamicMapping .value ().name (). toLowerCase ());
534
+ mainFieldNode .put (TYPE_DYNAMIC , dynamicMapping .value ().getMappedName ());
536
535
}
537
536
}
538
537
0 commit comments