【问题标题】:Creating a new field by Mutating existing Longitude and Latitude fields in ElasticSearch Index通过改变 ElasticSearch 索引中现有的经度和纬度字段来创建新字段
【发布时间】:2017-10-13 19:08:46
【问题描述】:

是否可以在 Kibana Dev 中改变两个字段。工具/控制台,即使用现有索引和已​​从 MySQL 导入的字段,将纬度、经度转换为 geo_point 类型字段。

我们的想法是不要从 MySQL 重新导入所有数据并通过 Logstash。

【问题讨论】:

    标签: elasticsearch kibana


    【解决方案1】:

    您必须更新映射以添加 geo_point 字段。然后,您可以通过滚动请求将 geo_point 字段添加到每个文档,使用纬度-经度字段并批量更新文档。

    批量 API:https://www.elastic.co/guide/en/elasticsearch/guide/current/bulk.html

    滚动:https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html

    【讨论】:

    • 您能否提供通过控制台(开发工具)进行映射的示例,这将非常有帮助。
    • 有没有向索引中的现有文档添加地理点字段的示例?
    • PUT index/type/_mapping { "properties": { "field_name": { "type": "geo_point" } } }
    • 好的,它已添加,现在我只想将 lat 和 lon 添加到我刚刚添加的“位置”字段中,您有什么想法吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-14
    • 1970-01-01
    • 2014-12-15
    • 2011-11-05
    相关资源
    最近更新 更多