Skip to content

SimpleElasticsearchRepository - delete no longers supports routing? #2754

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

Closed
whalewired opened this issue Nov 6, 2023 · 1 comment · Fixed by #2755
Closed

SimpleElasticsearchRepository - delete no longers supports routing? #2754

whalewired opened this issue Nov 6, 2023 · 1 comment · Fixed by #2755
Labels
type: bug A general bug

Comments

@whalewired
Copy link

whalewired commented Nov 6, 2023

We use Routing on a Document.

When upgrading from 4 to 5 we now get exception when calling delete using ElasticsearchRepository:

org.springframework.data.elasticsearch.UncategorizedElasticsearchException: [es/delete] failed: [routing_missing_exception] routing is required for

As far as I can tell the routing support has been removed in

https://github.com/spring-projects/spring-data-elasticsearch/blame/main/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java

Version 5.1.5

	public void delete(T entity) {
		Assert.notNull(entity, "Cannot delete 'null' entity.");
		doDelete(extractIdFromBean(entity), getIndexCoordinates());
	}

Version 4.4.6

	public void delete(T entity) {
		Assert.notNull(entity, "Cannot delete 'null' entity.");
		doDelete(extractIdFromBean(entity), operations.getEntityRouting(entity), getIndexCoordinates());
	}

Is there another way delete is supposed to be used when routing is involved?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 6, 2023
@sothawo sothawo added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 6, 2023
@sothawo
Copy link
Collaborator

sothawo commented Nov 6, 2023

That shouldn't have been removed (was already in 5.0). UP to now nobody noticed. Thanks for bringing this up. Will try to fix it later today.

sothawo added a commit to sothawo/spring-data-elasticsearch that referenced this issue Nov 6, 2023
sothawo added a commit that referenced this issue Nov 6, 2023
@sothawo sothawo added this to the 5.2 GA (2023.1.0) milestone Nov 6, 2023
sothawo added a commit that referenced this issue Nov 6, 2023
Original Pull Request #2755
Closes #2754

(cherry picked from commit 9abcacb)
sothawo added a commit that referenced this issue Nov 6, 2023
Original Pull Request #2755
Closes #2754

(cherry picked from commit 9abcacb)
(cherry picked from commit 64cf956)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants