Skip to content

Commit 1b867cf

Browse files
author
avolz
committed
DATAES-140 add value "no" in Enum FieldIndex.
1 parent 5e3a50c commit 1b867cf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/org/springframework/data/elasticsearch/annotations/FieldIndex.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
/**
1919
* @author Artur Konczak
2020
* @author Mohsin Husen
21+
* @author Alexander Volz
22+
* @author Dennis Maaß
2123
*/
2224
public enum FieldIndex {
23-
not_analyzed, analyzed
25+
not_analyzed, analyzed, no
2426
}

src/main/java/org/springframework/data/elasticsearch/core/MappingBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
* @author Mohsin Husen
4242
* @author Artur Konczak
4343
* @author Kevin Leturc
44+
* @author Alexander Volz
45+
* @author Dennis Maaß
4446
*/
4547

4648
class MappingBuilder {
@@ -208,7 +210,7 @@ private static void addSingleFieldMapping(XContentBuilder xContentBuilder, java.
208210
? fieldAnnotation.pattern() : fieldAnnotation.format());
209211
}
210212
}
211-
if (FieldIndex.not_analyzed == fieldAnnotation.index()) {
213+
if (FieldIndex.not_analyzed == fieldAnnotation.index() || FieldIndex.no == fieldAnnotation.index()) {
212214
xContentBuilder.field(FIELD_INDEX, fieldAnnotation.index().name().toLowerCase());
213215
}
214216
if (isNotBlank(fieldAnnotation.searchAnalyzer())) {

0 commit comments

Comments
 (0)