ElasticSearch的Rest的访问方式查询总量

由于安装ElasticSearch插件会影响ES的性能,所以会尽量减少ES的插件安装

可以通过ElasticSearch-Sql插件

然后将生成的执行参数拷贝

{
 "query": {
        "bool": {
            "must": {
                "bool": {
                    "must": [
                        {
                            "range": {
                                "order_date": {
                                    "from": "1508342400000",
                                    "to": null,
                                    "include_lower": true,
                                    "include_upper": true
                                }
                            }
                        },
                        {
                            "match": {
                                "payment_status": {
                                    "query": "2",
                                    "type": "phrase"
                                }
                            }
                        },
                        {
                            "match": {
                                "system_id": {
                                    "query": "d29e4e07f1db440982b689447bedf97a",
                                    "type": "phrase"
                                }
                            }
                        }
                    ]
                }
            }
        }
    },
    "_source": {
        "includes": [
            "SUM"
        ],
        "excludes": []
    },
    "aggregations": {
        "SUM(tx_money)": {
            "sum": {
                "field": "tx_money"
            }
        }
    }
}

然后在ElasticSearch-Head插件中

原文地址:https://www.cnblogs.com/atomicbomb/p/7698193.html