1

My class looks like that:

@Document(indexName = "a")
@Mapping(mappingPath = "mapping-a.json")
public class A {

    @Id
    private String id;

What I would like to do is to instead of just creating and using index a here I would like to create some index and use alias (with some config) for it. Like in ES documentation example from Elasticsearch documentation:

enter image description here

The only solution that I can think of is to just "manually" create index on startup, but I was hoping for some built in feature in Spring Data Elasticsearch.

1 Answer 1

1

We don't support creating an alias on index creation yet, you'd like to open an issue in Jira for that.

Your case looks like you should create an index template (available since Spring Data Elasticsearch 4.1) for the index name pattern logs_2030* that defines the alias, no need to specify this on the entity class.

Sign up to request clarification or add additional context in comments.

1 Comment

Thx, I didn't knew this feature of ES and Spring Data ES. It looks like it would be nice to have this alias in index creation. With my limited understanding it seems that using index template is a little bit of workaround - but maybe I just connect the dots longer way :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.