/// <summary>
        /// Update index alias, e.g. switch usage of alias from current index to new index.
        /// </summary>
        /// <param name="alias">Alias name.</param>
        /// <param name="currentIndex">Current index name.</param>
        /// <param name="newIndex">New index name.</param>
        public void UpdateIndexAlias(String alias,
                                     String currentIndex,
                                     String newIndex)
        {
            ElasticsearchResponse <DynamicResponse> response;

            if (newIndex.IsNotEmpty())
            {
                // Create new alias.
                response = _client.IndicesPutAlias <DynamicResponse>(newIndex, alias, null);
                CheckResponse(response);
            }

            if (currentIndex.IsNotEmpty())
            {
                // Remove old alias.
                response = _client.IndicesDeleteAlias <DynamicResponse>(currentIndex, alias);
                CheckResponse(response);
            }
        }