Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

youssef3wi
Copy link
Contributor

  • You have read the Spring Data contribution guidelines.
  • There is a ticket in the bug tracker for the project in our issue tracker. Add the issue number to the Closes #issue-number line below
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Closes #2599

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 2, 2024
Copy link
Collaborator

@sothawo sothawo left a 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.

Copy link
Collaborator

@sothawo sothawo left a 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

youssef3wi and others added 3 commits May 21, 2024 18:22
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>
@youssef3wi youssef3wi force-pushed the gh-2599 branch 2 times, most recently from 102c502 to cf02680 Compare May 21, 2024 16:28
@youssef3wi youssef3wi requested a review from sothawo May 21, 2024 16:28
Copy link
Collaborator

@sothawo sothawo left a 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

youssef3wi and others added 2 commits May 22, 2024 22:05
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set alias for an index with annotation upon creation.
3 participants