New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for index aliases. #2905
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took me a while to get to this.
I don't think that AliasCoordinates
should be added to IndexCoordinates
. IndexCoordinates
is used throughout the library wherever an index name or names are passed. Adding the alias information might cause the user to think he might add some alias info to other functions where this is definitely not. I think that the alias information should be passed to the IndicesTemplate.create()
and ReactiveIndicesTemplate.create()
functions like it's done with mapping and settings. This is something only relevant during index creation.
Also I am not sure about reusing the @Query
annotation. In Spring Data context this normally only exists on repository methods. The documentation for @Query
says that the query can contain parameters like ?0
, this of course is not valis in the index creation process. I'd rather suggest to creat a new @Filter
annotation that is only used in the index creation context.
src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, have been pretty busy (and sick in between), just a first remark, had no time to look further
src/main/java/org/springframework/data/elasticsearch/core/mapping/AliasCoordinates.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Youssef Aouichaoui <youssef3wi@icloud.com>
Co-authored-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
Signed-off-by: Youssef Aouichaoui <youssef3wi@icloud.com>
102c502
to
cf02680
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work, thank you.
Some minor things. And the reactive integration test is missing
src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java
Show resolved
Hide resolved
src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java
Show resolved
Hide resolved
.../java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java
Show resolved
Hide resolved
...org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
Show resolved
Hide resolved
Signed-off-by: Youssef Aouichaoui <youssef3wi@icloud.com> Co-authored-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
Signed-off-by: Youssef Aouichaoui <youssef3wi@icloud.com>
Closes #2599