Elasticsearch重命名索引

时间:2017-12-21 07:52:00

标签: elasticsearch

我的索引名为"产品"另一个名为" products_temp"。我想填写" products_temp"使用新产品然后删除"产品"索引并重命名" products_temp"索引到"产品"。这在Elasticsearch中是否可行?如果是,推荐的方法是什么?

我必须重复这个"产品重新同步"每天处理一次。

2 个答案:

答案 0 :(得分:1)

无法重命名索引。推荐的方法是使用alias并将其指向您想要的任何索引。

参考:How to rename indices

答案 1 :(得分:0)

它是完全可转换的,在弹性输出上的beat.yml配置中添加:

@When("switch flicked is {string}")
public String switchFlickedIs(String SwitchState,List<String>colors){
   String Set Color= "";
   If SwitchState.equals(true){
    for(int i=0; i<colors.size();i++){
      SetColor= colors.get(i)
     }
    retutn SetColor; 
   }else 
    return SetColor;
}

@Then("Then the lightbulb should show {string} at the end")
public void VerifyLightbulb color(String FinalColor){
  Assert.equals(FinalColor,SetColor, "Final Color is not red");
}
`````

Screenshot