DATAES-285 - Polishing

* drop superfluous class FieldIndex
* change FieldType text and keyword starting with capital letters

Original commit: 089d7746be
This commit is contained in:
xhaggi
2018-05-07 13:16:01 +02:00
parent 9c235cd53c
commit ace5a21b05
10 changed files with 33 additions and 48 deletions

View File

@@ -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<String> authors = new ArrayList<>();

View File

@@ -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() {

View File

@@ -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")

View File

@@ -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

View File

@@ -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

View File

@@ -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() {

View File

@@ -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() {

View File

@@ -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