Polishing

This commit is contained in:
Peter-Josef Meisch 2024-08-06 18:14:33 +02:00
parent 06de217ceb
commit 03992ba722
No known key found for this signature in database
GPG Key ID: DE108246970C7708
4 changed files with 8 additions and 4 deletions

View File

@ -5,6 +5,7 @@
== New in Spring Data Elasticsearch 5.4 == New in Spring Data Elasticsearch 5.4
* Upgrade to Elasticsearch 8.14.3. * Upgrade to Elasticsearch 8.14.3.
* Allow to customize the mapped type name for @InnerField and @Field annotations.
[[new-features.5-3-0]] [[new-features.5-3-0]]
== New in Spring Data Elasticsearch 5.3 == New in Spring Data Elasticsearch 5.3

View File

@ -241,7 +241,7 @@ public @interface Field {
* @since 5.1 * @since 5.1
*/ */
boolean storeEmptyValue() default true; boolean storeEmptyValue() default true;
/** /**
* overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType} * overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType}
* *

View File

@ -172,7 +172,7 @@ public @interface InnerField {
* @since 5.4 * @since 5.4
*/ */
KnnIndexOptions[] knnIndexOptions() default {}; KnnIndexOptions[] knnIndexOptions() default {};
/** /**
* overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType} * overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType}
* *

View File

@ -177,7 +177,8 @@ public class MappingBuilder {
var dynamicMapping = docAnnotation != null ? docAnnotation.dynamic() : null; var dynamicMapping = docAnnotation != null ? docAnnotation.dynamic() : null;
final FieldType fieldType = FieldType.Auto; final FieldType fieldType = FieldType.Auto;
mapEntity(objectNode, entity, true, "", false, fieldType, fieldType.getMappedName(), null, dynamicMapping, runtimeFields); mapEntity(objectNode, entity, true, "", false, fieldType, fieldType.getMappedName(), null, dynamicMapping,
runtimeFields);
if (!excludeFromSource.isEmpty()) { if (!excludeFromSource.isEmpty()) {
ObjectNode sourceNode = objectNode.putObject(SOURCE); ObjectNode sourceNode = objectNode.putObject(SOURCE);
@ -212,7 +213,8 @@ public class MappingBuilder {
} }
private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentEntity<?> entity, private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentEntity<?> entity,
boolean isRootObject, String nestedObjectFieldName, boolean nestedOrObjectField, FieldType fieldType, String fieldTypeMappedName, boolean isRootObject, String nestedObjectFieldName, boolean nestedOrObjectField, FieldType fieldType,
String fieldTypeMappedName,
@Nullable Field parentFieldAnnotation, @Nullable Dynamic dynamicMapping, @Nullable Document runtimeFields) @Nullable Field parentFieldAnnotation, @Nullable Dynamic dynamicMapping, @Nullable Document runtimeFields)
throws IOException { throws IOException {
@ -486,6 +488,7 @@ public class MappingBuilder {
/** /**
* Return the mapping type name to be used for the {@link Field} * Return the mapping type name to be used for the {@link Field}
*
* @param field field to return the mapping type name for * @param field field to return the mapping type name for
* @return the mapping type name * @return the mapping type name
*/ */