ES的聚合操作
构建数据: @Test public void createIndex(){ /** * 创建索引 * */ client.admin().indices().prepareCreate("player").get(); } /** * 创建映射 */ @Test public void testCreateIndexMapping_boost() throws Exception{ /** * 格式: "mappings": { "player": { "properties": { "name": {"index": "not_analyzed","type": "string"}, "age": {"type": "integer"}, "salary": {"type": "integer"}, "team": {"index": "not_analyzed","type": "string"}, "position": {"index": "not_analyzed","type": "string"} } } } */ //构建json的数据格式,创建映射 XContentBuilder mappingBuilder = XContentFactory.jsonBuilder() .startObject() .startObject("player")