gpt4 book ai didi

elasticsearch - 文档计数大于 'x',geo_point聚合elasticsearch

转载 作者:行者123 更新时间:2023-12-03 01:38:44 26 4
gpt4 key购买 nike

我目前正在执行以下查询,以在 Elasticsearch 中以一定精度聚合所有点。

{
"aggs": {
"coordinates": {
"geohash_grid": {
"field": "properties.Geometry.geo_point",
"precision": 12
},
"aggs": {
"centroid": {
"geo_centroid": {
"field": "properties.Geometry.geo_point"
}
}
}
}
}
}

响应是
      "aggregations": {
"coordinates": {
"buckets": [
{
"key": "s00000000000",
"doc_count": 82571,
"centroid": {
"location": {
"lat": 0,
"lon": 0
},
"count": 82571
}
},
{
"key": "6gyf4bf8m0uh",
"doc_count": 58587,
"centroid": {
"location": {
"lat": -23.55052001774311,
"lon": -46.633309721946716
},
"count": 58587
}
},
{
"key": "7h2y8hz76g8m",
"doc_count": 14551,
"centroid": {
"location": {
"lat": -19.924501832574606,
"lon": -43.93523778766394
},
"count": 14551
}
}
}

我需要获取计数大于一定数量的所有存储桶。我怎样才能做到这一点?

最佳答案

您可以添加字段

GET _search
{
"query": {
"range" : {
"age" : {
"gte" : 5000,
}
}
}
}

如文档中的描述:
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html

关于elasticsearch - 文档计数大于 'x',geo_point聚合elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49900607/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com