Elasticsearch _mapping
http方式创建mapping: PUT my_index/my_type/_mapping { "properties": { "category": { "type": "long", "index": "not_analyzed" }, "connection": { "type": "long", "index": "not_analyzed" }, "time": { "type": "long", "index": "not_analyzed" }, "user": { "type": "string", "index": "not_analyzed" }, "ip": { "type": "ip", "index": "not_analyzed" } } }
注: "index": "not_analyzed" 指定字段不分词
默认 Elasticsearch 对 text 类型的字段是不可聚合的,基本类型可聚合