You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding the ElasticSearchrestTemplate delete or doDelete method to delete data, if there is no data, then ID is also returned, which should be a bug. If there is no data, ID should not be returned, so it is not known whether the data has been deleted. Can you provide a method to return the deleteresponse object and let the developer judge it by himself.
Solution:
protected DeleteResponse doDeleteResponse(String id, @nullable String routing, IndexCoordinates index) {
Assert.notNull(id, "id must not be null");
Assert.notNull(index, "index must not be null");
DeleteRequest request = prepareWriteRequest(
requestFactory.deleteRequest(elasticsearchConverter.convertId(id), routing, index));
return execute(client -> client.delete(request, RequestOptions.DEFAULT));
}