1 ES 6.0版本后字段属性都有变化,
2 5.x中设置字段不进行分词使用"type":“string”,“index”:“not_analyzed”,而在6.x中设置字段使 用"type":“keyword”
,6.x想要进行分词"type":“text”,string类型已经不能使用。
3 5.x中 field("index", "not_analyzed" .field("store", "yes")
6.x版本就会报标题中的错误,应该改为 field("index", "true" .field("store", "true")
6.x中只执行true,false,“true”,“false”.
4 在Api聚合时报 :字段Fielddata is disabled on text fields by default,分组的字段默认fielddata是关闭的,须在在mapping 时开启,这个比较消耗内存,注意index必须是true。
设置如下:
.startObject("team")
.field("type", "text")
.field("index", "true")
.field("fielddata","true")
.endObject()