File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
grails-app/services/grails/plugins/elasticsearch Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -316,13 +316,15 @@ class ElasticSearchAdminService {
316316 LOG . debug " Creating alias ${ alias} , pointing to index ${ index} ..."
317317 String oldIndex = indexPointedBy(alias)
318318 elasticSearchHelper. withElasticSearch { RestHighLevelClient client ->
319+ IndicesAliasesRequest request = new IndicesAliasesRequest ()
319320 if (oldIndex && oldIndex != index) {
320321 LOG . debug " Index used to point to ${ oldIndex} , removing ..."
321- new IndicesAliasesRequest.AliasActions (IndicesAliasesRequest.AliasActions.Type . REMOVE )
322- .index(oldIndex)
323- .alias(alias)
322+ IndicesAliasesRequest.AliasActions removeAliasAction = new IndicesAliasesRequest.AliasActions (IndicesAliasesRequest.AliasActions.Type . REMOVE )
323+ .index(oldIndex)
324+ .alias(alias)
325+ request. addAliasAction(removeAliasAction)
324326 }
325- IndicesAliasesRequest request = new IndicesAliasesRequest ()
327+
326328 IndicesAliasesRequest.AliasActions aliasAction =
327329 new IndicesAliasesRequest.AliasActions (IndicesAliasesRequest.AliasActions.Type . ADD )
328330 .index(index)
You can’t perform that action at this time.
0 commit comments