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

Implement support for reindex API [DATAES-955] #1529

Closed
spring-projects-issues opened this issue Oct 16, 2020 · 4 comments · Fixed by #2070
Closed

Implement support for reindex API [DATAES-955] #1529

spring-projects-issues opened this issue Oct 16, 2020 · 4 comments · Fixed by #2070
Labels
in: core Issues in core support status: worked on a contributor is working on this issue type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

sothawo opened DATAES-955 and commented

IndexOperations should support the reindex API, see linked reference


Reference URL: https://www.elastic.co/guide/en/elasticsearch/reference/7.9/docs-reindex.html

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core support labels Dec 31, 2020
@oni7uka
Copy link
Contributor

oni7uka commented Jan 19, 2022

I am using reindex api, I can send pull request to implement this enhancement, the implementation is similar to putTemplate, but I have some confusion, reindex and putTemplate are not dependent on a specific index, but the implementation of IndexOperations is RestIndexTemplate which constructor must specify IndexCoordinates or boundClass, It doesn't make sense

@sothawo
Copy link
Collaborator

sothawo commented Jan 19, 2022

####about putTemplate

Elasticsearch has this under Index APIs that's the reason why it is in the IndexOperations interface. I agree that it makes no sense to have to get an IndexOperations by providing an indexname or class when it is not needed.

We could introduce something like

public class IndexCoordinates {

	public static final IndexCoordinates UNSPECIFIED = IndexCoordinates.of("UNSPECIFIED");
  
	// ...
}

in order to be able to obtain an IndexCoordinates without specifying an index. Using the capitals in the name ensures that this cannot be used in a request that needs an index name.

about reindex

Elasticsearch lists this under Document APIs, so it should go as a method into DocumentOperations and as thus should be implemented in the ElasticsearchTemplate classes. If you want to implement this: we need it in imperative and in reactive code, tests would probably
be integration tests with indexing into one index, then reindex and then read from the second one.

If you wanna do that, give me short notice, I'll mark the issue then as being worked on (although the number of people working on issues is low, almost only me ;-) )

@oni7uka
Copy link
Contributor

oni7uka commented Jan 20, 2022

Reindex does need to be implemented in DocumentOperations so it seems reasonable. And yes, I will implement this.

@sothawo sothawo added the status: worked on a contributor is working on this issue label Jan 20, 2022
oni7uka added a commit to oni7uka/spring-data-elasticsearch that referenced this issue Jan 21, 2022
sothawo pushed a commit that referenced this issue Jan 26, 2022
Original Pull Request #2070 
Closes #1529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support status: worked on a contributor is working on this issue type: enhancement A general enhancement
Projects
None yet
3 participants