mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-29 07:12:26 +00:00
DATAES-91 - removed merge conflict file
This commit is contained in:
parent
37802761ed
commit
5e3a50c85c
@ -1,78 +0,0 @@
|
|||||||
diff a/src/main/java/org/springframework/data/elasticsearch/core/MappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/MappingBuilder.java (rejected hunks)
|
|
||||||
@@ -29,6 +29,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|
||||||
import org.springframework.core.GenericCollectionTypeResolver;
|
|
||||||
import org.springframework.data.annotation.Transient;
|
|
||||||
import org.springframework.data.elasticsearch.annotations.*;
|
|
||||||
+import org.springframework.data.elasticsearch.core.completion.Completion;
|
|
||||||
import org.springframework.data.elasticsearch.core.facet.FacetRequest;
|
|
||||||
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
|
|
||||||
import org.springframework.data.mapping.model.SimpleTypeHolder;
|
|
||||||
@@ -55,7 +56,8 @@ class MappingBuilder {
|
|
||||||
|
|
||||||
public static final String INDEX_VALUE_NOT_ANALYZED = "not_analyzed";
|
|
||||||
public static final String TYPE_VALUE_STRING = "string";
|
|
||||||
- public static final String TYPE_VALUE_GEO_POINT = "geo_point";
|
|
||||||
+ public static final String TYPE_VALUE_GEO_POINT = "geo_point";
|
|
||||||
+ public static final String TYPE_VALUE_COMPLETION = "completion";
|
|
||||||
|
|
||||||
private static SimpleTypeHolder SIMPLE_TYPE_HOLDER = new SimpleTypeHolder();
|
|
||||||
|
|
||||||
@@ -94,10 +96,11 @@ class MappingBuilder {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
- boolean isGeoField = isGeoField(field);
|
|
||||||
+ boolean isGeoField = isGeoField(field);
|
|
||||||
+ boolean isCompletionField = isCompletionField(field);
|
|
||||||
|
|
||||||
Field singleField = field.getAnnotation(Field.class);
|
|
||||||
- if (!isGeoField && isEntity(field) && isAnnotated(field)) {
|
|
||||||
+ if (!isGeoField && !isCompletionField && isEntity(field) && isAnnotated(field)) {
|
|
||||||
if (singleField == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
@@ -110,9 +113,13 @@ class MappingBuilder {
|
|
||||||
|
|
||||||
MultiField multiField = field.getAnnotation(MultiField.class);
|
|
||||||
|
|
||||||
- if (isGeoField) {
|
|
||||||
- applyGeoPointFieldMapping(xContentBuilder, field);
|
|
||||||
- }
|
|
||||||
+ if (isGeoField) {
|
|
||||||
+ applyGeoPointFieldMapping(xContentBuilder, field);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (isCompletionField) {
|
|
||||||
+ applyCompletionFieldMapping(xContentBuilder, field);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
if (isRootObject && singleField != null && isIdField(field, idFieldName)) {
|
|
||||||
applyDefaultIdFieldMapping(xContentBuilder, field);
|
|
||||||
@@ -153,6 +160,12 @@ class MappingBuilder {
|
|
||||||
.endObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
+ private static void applyCompletionFieldMapping(XContentBuilder xContentBuilder, java.lang.reflect.Field field) throws IOException {
|
|
||||||
+ xContentBuilder.startObject(field.getName());
|
|
||||||
+ xContentBuilder.field(FIELD_TYPE, TYPE_VALUE_COMPLETION)
|
|
||||||
+ .endObject();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
private static void applyDefaultIdFieldMapping(XContentBuilder xContentBuilder, java.lang.reflect.Field field)
|
|
||||||
throws IOException {
|
|
||||||
xContentBuilder.startObject(field.getName())
|
|
||||||
@@ -304,7 +317,11 @@ class MappingBuilder {
|
|
||||||
return fieldAnnotation != null && (FieldType.Nested == fieldAnnotation.type() || FieldType.Object == fieldAnnotation.type());
|
|
||||||
}
|
|
||||||
|
|
||||||
- private static boolean isGeoField(java.lang.reflect.Field field) {
|
|
||||||
- return field.getType() == GeoPoint.class || field.getAnnotation(GeoPointField.class) != null;
|
|
||||||
- }
|
|
||||||
+ private static boolean isGeoField(java.lang.reflect.Field field) {
|
|
||||||
+ return field.getType() == GeoPoint.class || field.getAnnotation(GeoPointField.class) != null;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ private static boolean isCompletionField(java.lang.reflect.Field field) {
|
|
||||||
+ return field.getType() == Completion.class;
|
|
||||||
+ }
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user