diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldIndex.java b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldIndex.java deleted file mode 100644 index e5642551a..000000000 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldIndex.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2014 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.annotations; - -/** - * @author Artur Konczak - * @author Mohsin Husen - * @author Alexander Volz - * @author Dennis Maaß - */ -public enum FieldIndex { - not_analyzed, analyzed, no -} diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java index ceaa6ce94..d78c95b9a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java @@ -21,5 +21,17 @@ package org.springframework.data.elasticsearch.annotations; * @author Artur Konczak */ public enum FieldType { - text, Integer, Long, Date, Float, Double, Boolean, Object, Auto, Nested, Ip, Attachment, keyword + Text, + Integer, + Long, + Date, + Float, + Double, + Boolean, + Object, + Auto, + Nested, + Ip, + Attachment, + Keyword } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java b/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java index ce1e71633..fe5ddaed8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/facet/ArticleEntity.java @@ -16,7 +16,7 @@ package org.springframework.data.elasticsearch.core.facet; import static org.springframework.data.elasticsearch.annotations.FieldType.Integer; -import static org.springframework.data.elasticsearch.annotations.FieldType.text; +import static org.springframework.data.elasticsearch.annotations.FieldType.Text; import java.util.ArrayList; import java.util.List; @@ -36,14 +36,14 @@ public class ArticleEntity { @Id private String id; private String title; - @Field(type = text, fielddata = true) + @Field(type = Text, fielddata = true) private String subject; @MultiField( - mainField = @Field(type = text), + mainField = @Field(type = Text), otherFields = { - @InnerField(suffix = "untouched", type = text, store = true, fielddata = true, indexAnalyzer = "keyword"), - @InnerField(suffix = "sort", type = text, store = true, indexAnalyzer = "keyword") + @InnerField(suffix = "untouched", type = Text, store = true, fielddata = true, indexAnalyzer = "keyword"), + @InnerField(suffix = "sort", type = Text, store = true, indexAnalyzer = "keyword") } ) private List authors = new ArrayList<>(); diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java index 545704e3c..e02e2b384 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/ParentEntity.java @@ -19,7 +19,6 @@ import org.springframework.core.style.ToStringCreator; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldIndex; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.Parent; @@ -38,7 +37,7 @@ public class ParentEntity { @Id private String id; - @Field(type = FieldType.text, store = true) + @Field(type = FieldType.Text, store = true) private String name; public ParentEntity() { @@ -67,10 +66,10 @@ public class ParentEntity { @Id private String id; - @Field(type = FieldType.text, store = true) + @Field(type = FieldType.Text, store = true) @Parent(type = PARENT_TYPE) private String parentId; - @Field(type = FieldType.text, store = true) + @Field(type = FieldType.Text, store = true) private String name; public ChildEntity() { diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleDateMappingEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleDateMappingEntity.java index 66f0e30d0..d0564c192 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleDateMappingEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleDateMappingEntity.java @@ -1,7 +1,7 @@ package org.springframework.data.elasticsearch.entities; import static org.springframework.data.elasticsearch.annotations.FieldType.*; -import static org.springframework.data.elasticsearch.annotations.FieldType.text; +import static org.springframework.data.elasticsearch.annotations.FieldType.Text; import java.util.Date; @@ -19,7 +19,7 @@ public class SampleDateMappingEntity { @Id private String id; - @Field(type = text, index = false, store = true, analyzer = "standard") + @Field(type = Text, index = false, store = true, analyzer = "standard") private String message; @Field(type = Date, format = DateFormat.custom, pattern = "dd.MM.yyyy hh:mm") diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java index b931346c9..751cf8c3d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntity.java @@ -49,9 +49,9 @@ public class SampleEntity { @Id private String id; - @Field(type = text, store = true, fielddata = true) + @Field(type = Text, store = true, fielddata = true) private String type; - @Field(type = text, store = true, fielddata = true) + @Field(type = Text, store = true, fielddata = true) private String message; private int rate; @ScriptedField diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java index 21d38fcfc..d88f909b9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleEntityUUIDKeyed.java @@ -48,7 +48,7 @@ public class SampleEntityUUIDKeyed { @Id private UUID id; private String type; - @Field(type = FieldType.text, fielddata = true) + @Field(type = FieldType.Text, fielddata = true) private String message; private int rate; @ScriptedField diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java index 0714e73a9..08400dede 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleInheritedEntity.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.entities; -import static org.springframework.data.elasticsearch.annotations.FieldType.text; +import static org.springframework.data.elasticsearch.annotations.FieldType.Text; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; @@ -26,7 +26,7 @@ import org.springframework.data.elasticsearch.annotations.Field; @Document(indexName = "test-index-sample-inherited", type = "mapping", shards = 1, replicas = 0, refreshInterval = "-1") public class SampleInheritedEntity extends AbstractInheritedEntity { - @Field(type = text, index = false, store = true, analyzer = "standard") + @Field(type = Text, index = false, store = true, analyzer = "standard") private String message; public String getMessage() { diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java index ce0ced54e..d66245664 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleMappingEntity.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.entities; -import static org.springframework.data.elasticsearch.annotations.FieldType.text; +import static org.springframework.data.elasticsearch.annotations.FieldType.Text; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; @@ -31,7 +31,7 @@ public class SampleMappingEntity { @Id private String id; - @Field(type = text, index = false, store = true, analyzer = "standard") + @Field(type = Text, index = false, store = true, analyzer = "standard") private String message; private NestedEntity nested; @@ -54,7 +54,7 @@ public class SampleMappingEntity { static class NestedEntity { - @Field(type = text) + @Field(type = Text) private String someField; public String getSomeField() { diff --git a/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java b/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java index b211aa566..7dc73908c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/entities/SampleTransientEntity.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.entities; -import static org.springframework.data.elasticsearch.annotations.FieldType.text; +import static org.springframework.data.elasticsearch.annotations.FieldType.Text; import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Transient; @@ -31,7 +31,7 @@ public class SampleTransientEntity { @Id private String id; - @Field(type = text, index = false, store = true, analyzer = "standard") + @Field(type = Text, index = false, store = true, analyzer = "standard") private String message; @Transient