【问题标题】:Creation_date for index in elasticsearch弹性搜索中索引的创建日期
【发布时间】:2017-07-14 04:49:20
【问题描述】:

我已在我的索引设置中添加索引创建日期为 下面

"settings" :{ 
  "index" :{ 
     "provided_name":"test",
     "creation_Date":"1493750591836",
     "number_of_shards" : "1",
     "number_of_replicas" : "0"
  }
 }

但是当我尝试发布 _template 时出现如下错误

  "unknown setting [index.creation_date] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"

这是否意味着创建时间设置不可用,请澄清一下。我无法在
https://www.elastic.co/guide/en/elasticsearch/reference/1.4/indices-update-settings.html

中找到更多详细信息

使用的版本是5.1

【问题讨论】:

    标签: elasticsearch elasticsearch-plugin elasticsearch-5


    【解决方案1】:

    您不能设置该设置,只能读取它。但是,您可以使用 mappings._meta 部分来存储您的自定义索引创建日期:

    PUT my_index
    {
      "settings" :{ 
       "index" :{ 
         "number_of_shards" : "1",
         "number_of_replicas" : "0"
        }
      },
      "mappings": {
        "test": {
          "_meta": { 
            "creation_date":"1493750591836"
          }
        }
      }
    }
    

    【讨论】:

    • 感谢您的信息。索引的提供名称和版本怎么样,如果使用模板,索引将如何知道它应该遵循模板。有没有办法在创建索引时指定它应该引用的模板?
    • 在模板中有一个名为“template”的属性,它应该捕获索引名称。如果您创建的索引与该模板名称匹配,则将应用该模板。
    • 感谢 val 澄清了事情。
    • 酷,很高兴它有帮助!
    猜你喜欢
    • 2018-07-15
    • 1970-01-01
    • 2019-09-28
    • 2022-08-17
    • 2020-08-16
    • 1970-01-01
    • 1970-01-01
    • 2017-07-07
    • 2023-03-03
    相关资源
    最近更新 更多