7
votes

In spring-data-elasticsearch 3.0.0.RC2, @Field annotation has a boolean index() and a String analyzer(). How to config "not_analyzed" with @Field annotation?

1

1 Answers

17
votes

With previous versions of Spring Data ES that worked with ES 2.x, you used to do it this way:

@Field(type=FieldType.String, index=FieldIndex.not_analyzed)
String myField;

With Spring Data ES 3.0.0 (which works with ES 5.x), you now do it like this:

@Field(type=FieldType.Keyword)
String myField;