51,396
社区成员




{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 3,
"max_score" : 1.0,
"hits" : [ {
"_index" : "demo",
"_type" : "information",
"_id" : "8cbadcec89a04f288b57a3296fee65f5",
"_score" : 1.0,
"_source" : {
"id" : "8cbadcec89a04f288b57a3296fee65f5",
"name" : "james",
"date" : 1501743474101,
"address" : "深圳福田",
"money" : null,
"money2" : 33.33
}
}, {
"_index" : "demo",
"_type" : "information",
"_id" : "b717309157b14fe7a66f0cf10669e542",
"_score" : 1.0,
"_source" : {
"id" : "b717309157b14fe7a66f0cf10669e542",
"name" : "jono",
"date" : 1501743474213,
"address" : "深圳罗湖",
"money" : null,
"money2" : 11.11
}
}, {
"_index" : "demo",
"_type" : "information",
"_id" : "8072a1f1c52240d8a031a43f703f2085",
"_score" : 1.0,
"_source" : {
"id" : "8072a1f1c52240d8a031a43f703f2085",
"name" : "jono",
"date" : 1501743473596,
"address" : "深圳南山",
"money" : null,
"money2" : 55.55
}
} ]
}
}
{
"fields": [
"id",
"name",
"money2"
],
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*"
}
}
}
},
"aggs": {
"nameCount": {
"terms": {
"field": "name"
},
"aggs": {
"idCount": {
"terms": {
"field": "id"
},
"aggs": {
"moneyAmount": {
"sum": {
"field": "money2"
}
}
}
}
}
}
}
}