Rollover Index Throws Exception

I have an index which uses ILM. The index rolls over every week. We use Spring-data to read and write for Elasticsearch. My index just rolled over today and we are having trouble with writing to it. It fails with the following error. We write to the es alias and not to the index name since ILM takes care of index management

Processor.process:61 - error occurred while saving DTOs:
org.springframework.data.elasticsearch.RestStatusException: Elasticsearch exception [type=illegal_argument_exception, reason=alias [analytics_alias] has more than one index associated with it [analytics_index-000001, analytics_index-000002], can't execute a single index op]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=alias [analytics_alias] has more than one index associated with it [analytics_index-000001, analytics_index-000002], can't execute a single index op]]

However if you look at the alias only 1 alias is write enabled

{
  "analytics_index-000001" : {
    "aliases" : {
      "analytics_alias" : {
        "is_write_index" : false
      }
    }
  },
  "analytics_index-000002" : {
    "aliases" : {
      "analytics_alias" : {
        "is_write_index" : true
      }
    }
  }
}

Hi,

Some operations, like the update API, are not supported on aliases that point to multiple indices, even if only one of them is the write index. This is because these operations internally perform a read before the write, and the read operation doesn't know which index to target.

If you're using the update API or any other API that doesn't support multi-index aliases, you'll need to target the specific index directly instead of the alias.

Regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.