I created two test index and one alias associated with them:
POST /_aliases
{
"actions" : [
{
"add" : {
"index" : "test",
"alias" : "alias_test",
"index_routing" : "1"
}
},
{
"add" : {
"index" : "test2",
"alias" : "alias_test"
}
}
]
}
However, when I tried to index document to test index with routing=1, it still throw out an error:
POST alias_test/test/test?routing=1
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "trying out Elasticsearch"
}
Error message:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Alias [alias_test] has more than one indices associated with it [[test2, test]], can't execute a single index op"
}
],
"type": "illegal_argument_exception",
"reason": "Alias [alias_test] has more than one indices associated with it [[test2, test]], can't execute a single index op"
},
"status": 400
}