private boolean disableNorms = false;
private boolean termVectorWithPositionOffsets = false;
private SortedMap<String, Object> subFields = Maps.newTreeMap();
+ private boolean store = false;
private KeywordFieldBuilder(NewIndexType indexType, String fieldName) {
this.indexType = indexType;
return this;
}
+ public KeywordFieldBuilder store() {
+ this.store = true;
+ return this;
+ }
+
public NewIndexType build() {
Map<String, Object> hash = new TreeMap<>();
if (subFields.isEmpty()) {
hash.putAll(ImmutableMap.of(
"type", FIELD_TYPE_KEYWORD,
"index", disableSearch ? INDEX_NOT_SEARCHABLE : INDEX_SEARCHABLE,
- "norms", String.valueOf(!disableNorms)));
+ "norms", String.valueOf(!disableNorms),
+ "store", String.valueOf(store)));
} else {
hash.put("type", "multi_field");
multiFields.put(fieldName, ImmutableMap.of(
"type", FIELD_TYPE_KEYWORD,
"index", INDEX_SEARCHABLE,
- "norms", "false"
+ "norms", "false",
+ "store", String.valueOf(store)
));
hash.put("fields", multiFields);