ES聚合查询

ES聚合查询

javascript 复制代码
{
  "query": {
    "bool": {
      "must": [
        {
          "terms": {
            "orderId": [
              "58880570952990",
              "58882596943998",
              "58880654706404"
            ]
          }
        },
        {
          "term": {
            "billType": "110"
          }
        }
      ],
      "must_not": [],
      "should": [],
      "filter": []
    }
  },
    "aggs": {
    "amount": {
      "sum": {
        "field": "amount"
      }
    },
    "orderIdcount": {
      "terms": {
        "field": "orderId",
        "size":300
      }
    }
  },
  "from": 0,
  "size": 1,
  "sort": [],
  "profile": false
}

https://www.cnblogs.com/wangzhuxing/p/9581947.html

javascript 复制代码
{
 "query": {
   "bool": {
     "must": [
       {
         "range": {
           "createTime": {
             "gte": "1629172800000",
             "lte": "1629192600000"
           }
         }
       }
     ],
     "must_not": [],
     "should": [],
     "filter": []
   }
 },
 "track_total_hits":true
}
相关推荐
刘梦凡呀41 分钟前
C#获取钉钉平台考勤记录
java·c#·钉钉
盒马coding1 小时前
第19节-非规范化数据类型-Composite-types
数据库·postgresql
best_virtuoso1 小时前
PostgreSQL 常见数组操作函数语法、功能
java·数据结构·postgresql
yudiandian20141 小时前
02 Oracle JDK 下载及配置(解压缩版)
java·开发语言
-雷阵雨-1 小时前
MySQL——桥梁JDBC
数据库·mysql·oracle
亿坊电商1 小时前
在PHP框架里如何进行数据库连接?
数据库·oracle·php
满昕欢喜1 小时前
SQL Server从入门到项目实践(超值版)读书笔记 28
数据库·sql·sqlserver
楚韵天工2 小时前
宠物服务平台(程序+文档)
java·网络·数据库·spring cloud·编辑器·intellij-idea·宠物
helloworddm2 小时前
Orleans Stream SubscriptionId 生成机制详解
java·系统架构·c#
失散132 小时前
分布式专题——43 ElasticSearch概述
java·分布式·elasticsearch·架构