代码之家  ›  专栏  ›  技术社区  ›  Xin

如何确保使用正确的模板创建索引?

  •  0
  • Xin  · 技术社区  · 8 年前

    我在elasticsearch中设置了一些模板,还设置了它们的模板匹配模式。

    1 回复  |  直到 8 年前
        1
  •  0
  •   Andrei Stefan    8 年前
    1. 在创建索引时,是否有方法在创建索引时指定模板?

    是的,但是你需要日志。Elasticsearch通常会记录(我认为只在所选的主节点上),一行内容如下:

    [o.e.c.m.MetaDataCreateIndexService] [node_name] [testingnow] creating index, cause [auto(bulk api)], templates [whatever], shards [5]/[1], mappings [_default_]
    

    显示在索引创建时使用的模板。