From be3ba66b8d9a539a180eb5414cc1dfb610dd5d24 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Thu, 10 Apr 2014 14:21:44 -0500 Subject: [PATCH] Add an example to updateAliases I've added an example for how to do an atomic alias swap with the updateAliases method. --- docs/api_methods_0_90.asciidoc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/api_methods_0_90.asciidoc b/docs/api_methods_0_90.asciidoc index 1b8e5f354..91a586ac6 100644 --- a/docs/api_methods_0_90.asciidoc +++ b/docs/api_methods_0_90.asciidoc @@ -2915,7 +2915,20 @@ Update specified aliases. The default method is `POST` and the usual <> apply. See http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/indices-aliases.html[the elasticsearch docs] for more about this method. -// no examples +.Perform an atomic alias swap, as for a rotating index +[source,js] +--------- +client.indices.updateAliases({ + body:{ + actions:[ + {remove: {index: 'myindex-20140410', alias: 'myindex'}}, + {add: {index: 'myindex-20140411', alias: 'myindex'}} + ] + } +}, function (errors, response) { + // ... +}); +--------- ==== Params