使用multi-search进行统计分析

1.请求

curl -XGET ndb4:9200/mgobjectforsearch/aad0978d-0fde-4cb8-a8b6-000f9b550900/_msearch --data-binary "@requests"; echo

2.返回

{
    "responses": [
        {
            "took": 2,
            "timed_out": false,
            "_shards": {
                "total": 8,
                "successful": 8,
                "failed": 0
            },
            "hits": {
                "total": 95,
                "max_score": 0,
                "hits": []
            },
            "aggregations": {
                "tags": {
                    "doc_count_error_upper_bound": 0,
                    "sum_other_doc_count": 0,
                    "buckets": [
                        {
                            "key": "Nigeria",
                            "doc_count": 95
                        }
                    ]
                }
            }
        },
        {
            "took": 2,
            "timed_out": false,
            "_shards": {
                "total": 8,
                "successful": 8,
                "failed": 0
            },
            "hits": {
                "total": 318,
                "max_score": 0,
                "hits": []
            },
            "aggregations": {
                "tags": {
                    "doc_count_error_upper_bound": 0,
                    "sum_other_doc_count": 0,
                    "buckets": [
                        {
                            "key": "Thailand",
                            "doc_count": 318
                        }
                    ]
                }
            }
        }
    ]
}

3.请求格式

{}
{ "size": 0, "query": { "terms": { "eceb64b5-c1dc-419d-a6b0-7abd8e2ec3d3|": [ "Kano"] } }, "aggs" : { "tags" : { "terms" : { "field" : "161efeb4-d143-4083-87c4-c28846c1472c|", "min_doc_count": 10, "size": 20 } } } }
{}
{ "size": 0, "query": { "terms": { "eceb64b5-c1dc-419d-a6b0-7abd8e2ec3d3|": [ "Yala" ] } }, "aggs" : { "tags" : { "terms" : { "field" : "161efeb4-d143-4083-87c4-c28846c1472c|", "min_doc_count": 10, "size": 20 } } } }

你可能感兴趣的:(使用multi-search进行统计分析)