栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

es聚合查询

es聚合查询

某个字段分组,排序、分页

GET mcs_monitor_decrpt_apply/_search
{
  "from": 0,
  "size": 0,
  "query": {
    "bool": {
      "adjust_pure_negative": true,
      "boost": 1
    }
  },
  "_source": {
    "includes": [],
    "excludes": []
  },
  "aggregations": {
    "fileApplyInfos": {
      "terms": {
        "field": "employeeCode",
        "size": 2,
        "min_doc_count": 1,
        "shard_min_doc_count": 0,
        "show_term_doc_count_error": false,
        "order": [
          {
            "_count": "desc"
          },
          {
            "_term": "asc"
          }
        ]
      },
      "aggregations": {
        "hit": {
          "top_hits": {
            "from": 0,
            "size": 2,
            "version": false,
            "explain": false,
            "_source": {
              "includes": [
                "serialNumber",
                "employeeCode",
                "userName",
                "approveStatus"
              ],
              "excludes": []
            },
            "sort": [
              {
                "approveStatus": {
                  "order": "desc"
                }
              }
            ]
          }
        }
      }
    }
  }
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/744911.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号