【问题标题】:Elasticsearch ignores my index template mappings when creating new index创建新索引时,Elasticsearch 会忽略我的索引模板映射
【发布时间】:2021-05-25 20:27:56
【问题描述】:

无论我做什么,当使用心跳进程创建索引时(7.10.2) Elasticsearch 映射所有字段,monitor.id 如下:

GET /heartbeat-7.10.2-2021.05.25
[...]
         "monitor" : {
          "properties" : {
            "id" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
[...]

即使我删除了索引、模板,并将模板更新为:

{
    "order" : 1,
    "index_patterns" : [
      "heartbeat-7.10.2-*"
    ],
    "settings" : {
    },
    "mappings" : {
      "dynamic": false,
      "properties" : {
        "monitor" : {
          "properties" : {
            "id" : {
              "ignore_above" : 1024,
              "type" : "keyword"
            }
          }
        }
      }
    },
    "aliases" : { }
  }

似乎模板配置被忽略了。 没有其他心跳模板。 这是有问题的,因为这样我不能使用例如monitor.id 用于聚合。这是多个字段的问题。

我对模板比较陌生,所以我可能遗漏了一些东西。

【问题讨论】:

  • 你能展示你从GET _cat/templates?v得到什么吗?

标签: elasticsearch


【解决方案1】:

显然我同时拥有 _template 和 _index_template 并且 _index_template 具有优先权

之后

delete _index_template/heartbeat*

效果很好。

【讨论】:

    猜你喜欢
    • 2023-03-05
    • 2020-09-23
    • 1970-01-01
    • 2020-01-13
    • 1970-01-01
    • 1970-01-01
    • 2017-03-11
    • 2015-02-02
    • 2015-04-07
    相关资源
    最近更新 更多