实现SQL Group By类似的效果select id,name ,sum(money) from table group by id,name

GET myindex/mytype/_search
{
"size": 0,
"query": {
"match_all": {}
},
"aggs": {
"sexprof": {
"terms": {
"script": {
"inline": "doc['id'].value +'|'+ doc['name.keyword'].value "
}
},
"aggs": {
"fl": {
"sum": {
"field": "F_FL"
}
},
"shui":{
"sum": {
"field": "F_SHIJI_SHUI"
}
}
}

}
}
}

 

相关文章:

  • 2022-12-23
  • 2021-11-22
  • 2022-02-25
  • 2021-11-10
  • 2022-01-12
  • 2021-06-09
  • 2021-12-13
  • 2022-12-23
猜你喜欢
  • 2021-09-05
  • 2021-12-13
  • 2022-12-23
  • 2021-04-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
相关资源
相似解决方案