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

es - elasticsearch - aggs - metrics - geo

es - elasticsearch - aggs - metrics - geo

世界上并没有完美的程序,但是我们并不因此而沮丧,因为写程序就是一个不断追求完美的过程。

问:geo_bounds有什么特点?
答:

问:geo_bounds如何使用?
答:

DELETE /geo_bounds_test

PUT /geo_bounds_test
{
  "mappings": {
    "properties": {
      "geo_point": {"type": "geo_point"}
    }
  }
}

POST /geo_bounds_test/_bulk
{"index": {"_id": 1}}
{"geo_point": [23, 45]}
{"index": {"_id": 2}}
{"geo_point": [58, 47]}
{"index": {"_id": 3}}
{"geo_point": [77, 44]}
{"index": {"_id": 4}}
{"geo_point": [66, 55]}


GET /geo_bounds_test/_search?size=0
{
  "aggs": {
    "geo_bounds_aggs": {
      "geo_bounds": {
        "field": "geo_point"
      }
    }
  }
}

# 结果
{
  "took" : 640,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 4,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  },
  "aggregations" : {
    "geo_bounds_aggs" : {
      "bounds" : {
        "top_left" : {
          "lat" : 54.999999990686774,
          "lon" : 22.999999970197678
        },
        "bottom_right" : {
          "lat" : 43.99999997578561,
          "lon" : 76.99999993667006
        }
      }
    }
  }
}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/487115.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

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

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