spring-data-elasticsearch icon indicating copy to clipboard operation
spring-data-elasticsearch copied to clipboard

Set alias for an index with annotation upon creation.

Open AIRahimi opened this issue 2 years ago • 4 comments

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html

The request body for index creation takes a mapping object, a setting object and an alias object. Today we can define the mapping and setting by annotation upon index creation.

It would be nice to be able to do this for alias as well.

@Alias annotation to define aliases when creating index.

AIRahimi avatar Jun 22 '23 08:06 AIRahimi

@sothawo Let me know if this is accepted. I can develop it and create PR.

AIRahimi avatar Jun 22 '23 08:06 AIRahimi

That would be possible.

How would you define the attributes in the @Alias annotation that are possible, especially the filter? One possibility I see here would be to set this as a String property of the annotation and then pass this in wrapped in a wrapper string.

sothawo avatar Jun 25 '23 06:06 sothawo

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Jul 02 '23 06:07 spring-projects-issues

I am on a 3 weeks vacation and have not been able to look any closer at it, but yes that could be a good solution.

AIRahimi avatar Jul 04 '23 12:07 AIRahimi