gpt4 book ai didi

elasticsearch - 使用Kibana覆盖/更新现有的Elasticsearch索引映射(geo_point)

转载 作者:行者123 更新时间:2023-12-03 00:07:32 25 4
gpt4 key购买 nike

我正在尝试更新我的Elasticsearch索引中geo_point字段的映射,但是遇到了问题。我在Kibana中使用开发工具控制台。

geo_point的数据采用双数组格式。我正在将spark与elasticsearch-hadoop-5.3.1.jar一起使用,数据进入了Elasticsearch / kibana,但仍保留为数字格式,而我需要将其转换为geo_point。

似乎一旦定义索引映射便无法更新。我尝试使用以下方法:

PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"my_location": {
"type": "geo_point"
}
}
}
}
}

-但这会导致“索引已存在异常”错误。

感谢您的任何建议。

最佳答案

您使用的命令只是尝试使用提及的映射来创建新索引。有关更多信息,请阅读第一个示例here中的脚注。
根据Elasticsearch文档,不可能更新现有字段的映射。

Updating Field Mappings

In general, the mapping for existing fields cannot be updated. Thereare some exceptions to this rule. For instance:

  • new properties can be added to Object datatype fields.
  • new multi-fields can be added to existing fields.
  • the ignore_above parameter can be updated.

由于 geo_point不属于上述任何情况,因此您无法修改该字段的映射。
您可能需要对数据进行 reindex

关于elasticsearch - 使用Kibana覆盖/更新现有的Elasticsearch索引映射(geo_point),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43879783/

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