Index Aliases and zero downtime with Spring data Elastisearch

Viewed 288

I am using version 4.2.2 of spring-data-elasticsearch in my project. We need to reindex some data every day, so we are using aliases. I have seen that there is a way to atomically remove an index from an alias and to include a new one. Link: https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html

My question is if that feature is supported and included as part of version 4.2.2 of spring-data-elasticsearch, at IndexOperations class level.

EDIT

Using AliasActions to remove an existing index (the old one) and to add an alias to the new index I am getting this exception:

java.lang.NoSuchMethodError: 'org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest$AliasActions org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest$AliasActions.isHidden(java.lang.Boolean)'

var aliasActions = new AliasActions()
      .add(new AliasAction.RemoveIndex(AliasActionParameters.builder()
          .withIndices(oldIndexName).build()))
      .add(new AliasAction.Add(
          AliasActionParameters.builder().withIndices(newIndexName)
              .withAliases(indexOps.getIndexCoordinates().getIndexNames()).build()));
1 Answers
Related