Skip to content

SimpleElasticsearchRepository - delete no longers supports routing? #2754

Closed
@whalewired

Description

@whalewired

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions