搜索结果正在快递途中
ES5.2.2支持geo排序+聚合

ES5.2.2支持geo排序+聚合

ES5.2.2支持geo排序+聚合

Elasticsearchliushui00001 发表了文章 • 1 个评论 • 3778 次浏览 • 2017-05-06 16:50 • 来自相关话题

ES5.2.2真的 支持geo排序+聚合 具体查询条件,这里不写了; 查询结果如下: { "took": 90, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 10, "max_score": null, "hits": [ { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000000", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000000", "equipName": "灭火剂0", "equipValue": 73, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000003", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000003", "equipName": "灭火剂3", "equipValue": 47, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000001", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000001", "equipName": "灭火剂1", "equipValue": 12, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000004", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000004", "equipName": "灭火剂4", "equipValue": 2, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000002", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000002", "equipName": "灭火剂2", "equipValue": 57, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000018", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000018", "equipName": "灭火剂8", "equipValue": 61, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000014", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000014", "equipName": "灭火剂4", "equipValue": 81, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000016", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000016", "equipName": "灭火剂6", "equipValue": 81, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000015", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000015", "equipName": "灭火剂5", "equipValue": 87, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000017", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000017", "equipName": "灭火剂7", "equipValue": 90, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] } ] }, "aggregations": { "aggEquip": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "1000000", "doc_count": 1, "sumEquipValue": { "value": 73 } }, { "key": "1000001", "doc_count": 1, "sumEquipValue": { "value": 12 } }, { "key": "1000002", "doc_count": 1, "sumEquipValue": { "value": 57 } }, { "key": "1000003", "doc_count": 1, "sumEquipValue": { "value": 47 } }, { "key": "1000004", "doc_count": 1, "sumEquipValue": { "value": 2 } }, { "key": "1000014", "doc_count": 1, "sumEquipValue": { "value": 81 } }, { "key": "1000015", "doc_count": 1, "sumEquipValue": { "value": 87 } }, { "key": "1000016", "doc_count": 1, "sumEquipValue": { "value": 81 } }, { "key": "1000017", "doc_count": 1, "sumEquipValue": { "value": 90 } }, { "key": "1000018", "doc_count": 1, "sumEquipValue": { "value": 61 } }, { "key": "10000210", "doc_count": 1, "sumEquipValue": { "value": 70 } }, { "key": "10000211", "doc_count": 1, "sumEquipValue": { "value": 55 } }, { "key": "1000027", "doc_count": 1, "sumEquipValue": { "value": 19 } }, { "key": "1000028", "doc_count": 1, "sumEquipValue": { "value": 25 } }, { "key": "1000029", "doc_count": 1, "sumEquipValue": { "value": 3 } }, { "key": "10000311", "doc_count": 1, "sumEquipValue": { "value": 97 } }, { "key": "10000312", "doc_count": 1, "sumEquipValue": { "value": 79 } }, { "key": "10000313", "doc_count": 1, "sumEquipValue": { "value": 95 } }, { "key": "10000314", "doc_count": 1, "sumEquipValue": { "value": 6 } }, { "key": "10000315", "doc_count": 1, "sumEquipValue": { "value": 8 } } ] } } }  

ES5.2.2支持geo排序+聚合

Elasticsearchliushui00001 发表了文章 • 1 个评论 • 3778 次浏览 • 2017-05-06 16:50 • 来自相关话题

ES5.2.2真的 支持geo排序+聚合 具体查询条件,这里不写了; 查询结果如下: { "took": 90, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 10, "max_score": null, "hits": [ { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000000", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000000", "equipName": "灭火剂0", "equipValue": 73, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000003", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000003", "equipName": "灭火剂3", "equipValue": 47, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000001", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000001", "equipName": "灭火剂1", "equipValue": 12, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000004", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000004", "equipName": "灭火剂4", "equipValue": 2, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "1-1000002", "_score": null, "_source": { "comId": 1, "comName": "佛山消防支队", "elemetType": 2, "equipCode": "1000002", "equipName": "灭火剂2", "equipValue": 57, "location": { "lat": 23.027237, "lon": 113.123618 }, "phone": "15986190299", "userName": "李成龙" }, "sort": [ 3740.583503580435 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000018", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000018", "equipName": "灭火剂8", "equipValue": 61, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000014", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000014", "equipName": "灭火剂4", "equipValue": 81, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000016", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000016", "equipName": "灭火剂6", "equipValue": 81, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000015", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000015", "equipName": "灭火剂5", "equipValue": 87, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] }, { "_index": "testindex", "_type": "testdoc07", "_id": "2-1000017", "_score": null, "_source": { "comId": 2, "comName": "禅城大队", "elemetType": 2, "equipCode": "1000017", "equipName": "灭火剂7", "equipValue": 90, "location": { "lat": 23.057237, "lon": 113.103618 }, "phone": "13925403119", "userName": "郭武斌" }, "sort": [ 7648.2045946025555 ] } ] }, "aggregations": { "aggEquip": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "1000000", "doc_count": 1, "sumEquipValue": { "value": 73 } }, { "key": "1000001", "doc_count": 1, "sumEquipValue": { "value": 12 } }, { "key": "1000002", "doc_count": 1, "sumEquipValue": { "value": 57 } }, { "key": "1000003", "doc_count": 1, "sumEquipValue": { "value": 47 } }, { "key": "1000004", "doc_count": 1, "sumEquipValue": { "value": 2 } }, { "key": "1000014", "doc_count": 1, "sumEquipValue": { "value": 81 } }, { "key": "1000015", "doc_count": 1, "sumEquipValue": { "value": 87 } }, { "key": "1000016", "doc_count": 1, "sumEquipValue": { "value": 81 } }, { "key": "1000017", "doc_count": 1, "sumEquipValue": { "value": 90 } }, { "key": "1000018", "doc_count": 1, "sumEquipValue": { "value": 61 } }, { "key": "10000210", "doc_count": 1, "sumEquipValue": { "value": 70 } }, { "key": "10000211", "doc_count": 1, "sumEquipValue": { "value": 55 } }, { "key": "1000027", "doc_count": 1, "sumEquipValue": { "value": 19 } }, { "key": "1000028", "doc_count": 1, "sumEquipValue": { "value": 25 } }, { "key": "1000029", "doc_count": 1, "sumEquipValue": { "value": 3 } }, { "key": "10000311", "doc_count": 1, "sumEquipValue": { "value": 97 } }, { "key": "10000312", "doc_count": 1, "sumEquipValue": { "value": 79 } }, { "key": "10000313", "doc_count": 1, "sumEquipValue": { "value": 95 } }, { "key": "10000314", "doc_count": 1, "sumEquipValue": { "value": 6 } }, { "key": "10000315", "doc_count": 1, "sumEquipValue": { "value": 8 } } ] } } }