将文档放入索引时,Elasticsearch发生冲突

问题描述 投票:0回答:1

我想创建索引并使用模板修改其设置,同时为其创建别名

"template_1" : {
    "order" : 0,
    "index_patterns" : [
      "test*"
    ],
    "settings" : {
      "index" : {
        "number_of_shards" : "2",
        "number_of_replicas" : "2"
      }
    },
    "mappings" : { },
    "aliases" : { 
        "some-alias" : { }
    }
  }
} 

当我尝试使用别名放置文档时,它会尝试使用别名创建索引。但是,我正在寻找某种东西来搜索具有该别名的索引,并抛出一个错误,指出该别名不存在索引]

我想创建一个索引并使用模板修改其设置,同时为其创建一个别名“ template_1”:{“ order”:0,“ index_patterns”:[“ test *”],“ ...

elasticsearch kibana elastic-stack elasticsearch-dsl aws-elasticsearch
1个回答
0
投票

问题是,您使用单个别名引用多个索引,因此当您PUT时,文档ES并不知道将其存储在哪个文档中。引用文档:

© www.soinside.com 2019 - 2024. All rights reserved.