【问题标题】:Setting up default mapping Elasticsearch设置默认映射 Elasticsearch
【发布时间】:2014-11-27 06:06:48
【问题描述】:

从文档中,您可以为每个索引设置默认映射定义,只需将 .json 文件放入 $ELASTICSEARCH_HOME/config/mappings/_default

但是,在这样做之后,我得到了错误:

MapperParsingException[映射 [default_mapping]];嵌套:MapperParsingException[解析后根类型映射不为空!

我的映射文件如下所示:

 {
  "event" : {
    "dynamic_templates" : [
      {
        "template_1" : {
          "match" : "*",
          "mapping" : {
            "type" : "string",
            "index": "not_analyzed"
          }
        }
      }
    ]
  }
}

问题是我需要为我创建的每个索引设置几件事,但我不想关心更新每个索引的映射,因为在执行此操作之前我需要询问索引是否存在。这意味着,在我的工作流程中,我只想索引文档,不想关心设置。

提前致谢!

【问题讨论】:

    标签: json indexing lucene elasticsearch mapping


    【解决方案1】:

    我使用索引模板解决了这个特定问题。不过,我还是觉得这里少了点什么……

    如果能提供有关此主题的更多信息,我将不胜感激。

    谢谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-19
      • 2017-02-23
      • 1970-01-01
      • 2018-12-21
      • 2011-12-15
      相关资源
      最近更新 更多