Skip to content

Remove deprecated methods. #3067

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

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ Some classes that probably are not used by a library user have been renamed, the
|===

=== Removals

The following methods that had been deprecated since release 5.3 have been removed:
```
DocumentOperations.delete(Query, Class<?>)
DocumentOperations.delete(Query, Class<?>, IndexCoordinates)
ReactiveDocumentOperations.delete(Query, Class<?>)
ReactiveDocumentOperations.delete(Query, Class<?>, IndexCoordinates)
```
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,6 @@ public ByQueryResponse delete(DeleteQuery query, Class<?> clazz) {
return delete(query, clazz, getIndexCoordinatesFor(clazz));
}

@Override
public ByQueryResponse delete(Query query, Class<?> clazz, IndexCoordinates index) {

Assert.notNull(query, "query must not be null");

DeleteByQueryRequest request = requestConverter.documentDeleteByQueryRequest(query, routingResolver.getRouting(),
clazz, index, getRefreshPolicy());

DeleteByQueryResponse response = execute(client -> client.deleteByQuery(request));

return responseConverter.byQueryResponse(response);
}

@Override
public ByQueryResponse delete(DeleteQuery query, Class<?> clazz, IndexCoordinates index) {
Assert.notNull(query, "query must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,6 @@ protected Mono<Boolean> doExists(String id, IndexCoordinates index) {
.onErrorReturn(NoSuchIndexException.class, false);
}

@Override
public Mono<ByQueryResponse> delete(Query query, Class<?> entityType, IndexCoordinates index) {

Assert.notNull(query, "query must not be null");

DeleteByQueryRequest request = requestConverter.documentDeleteByQueryRequest(query, routingResolver.getRouting(),
entityType, index, getRefreshPolicy());
return Mono.from(execute(client -> client.deleteByQuery(request))).map(responseConverter::byQueryResponse);
}

@Override
public Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType, IndexCoordinates index) {
Assert.notNull(query, "query must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,6 @@ public String delete(String id, Class<?> entityType) {
return this.delete(id, getIndexCoordinatesFor(entityType));
}

@Override
@Deprecated
public ByQueryResponse delete(Query query, Class<?> clazz) {
return delete(query, clazz, getIndexCoordinatesFor(clazz));
}

@Override
public String delete(Object entity) {
return delete(entity, getIndexCoordinatesFor(entity.getClass()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,6 @@ public Mono<String> delete(String id, IndexCoordinates index) {

abstract protected Mono<String> doDeleteById(String id, @Nullable String routing, IndexCoordinates index);

@Override
@Deprecated
public Mono<ByQueryResponse> delete(Query query, Class<?> entityType) {
return delete(query, entityType, getIndexCoordinatesFor(entityType));
}

@Override
public Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType) {
return delete(query, entityType, getIndexCoordinatesFor(entityType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,6 @@ default void bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index) {
*/
String delete(Object entity, IndexCoordinates index);

/**
* Delete all records matching the query.
*
* @param query query defining the objects
* @param clazz The entity class, must be annotated with
* {@link org.springframework.data.elasticsearch.annotations.Document}
* @return response with detailed information
* @since 4.1
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class)}
*/
@Deprecated
ByQueryResponse delete(Query query, Class<?> clazz);

/**
* Delete all records matching the query.
*
Expand All @@ -296,19 +283,6 @@ default void bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index) {
*/
ByQueryResponse delete(DeleteQuery query, Class<?> clazz);

/**
* Delete all records matching the query.
*
* @param query query defining the objects
* @param clazz The entity class, must be annotated with
* {@link org.springframework.data.elasticsearch.annotations.Document}
* @param index the index from which to delete
* @return response with detailed information
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class, IndexCoordinates)}
*/
@Deprecated
ByQueryResponse delete(Query query, Class<?> clazz, IndexCoordinates index);

/**
* Delete all records matching the query.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,6 @@ default Mono<Void> bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index)
*/
Mono<String> delete(String id, Class<?> entityType);

/**
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
*
* @param query must not be {@literal null}.
* @param entityType must not be {@literal null}.
* @return a {@link Mono} emitting the number of the removed documents.
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class)}
*/
@Deprecated
Mono<ByQueryResponse> delete(Query query, Class<?> entityType);

/**
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
*
Expand All @@ -347,18 +336,6 @@ default Mono<Void> bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index)
*/
Mono<ByQueryResponse> delete(DeleteQuery query, Class<?> entityType);

/**
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
*
* @param query must not be {@literal null}.
* @param entityType must not be {@literal null}.
* @param index the target index, must not be {@literal null}
* @return a {@link Mono} emitting the number of the removed documents.
* @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class, IndexCoordinates)}
*/
@Deprecated
Mono<ByQueryResponse> delete(Query query, Class<?> entityType, IndexCoordinates index);

/**
* Delete the documents matching the given {@link Query} extracting index from entity metadata.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private void doDelete(@Nullable ID id, @Nullable String routing, IndexCoordinate
public void deleteAll() {

executeAndRefresh((OperationsCallback<Void>) operations -> {
operations.delete(Query.findAll(), entityClass, getIndexCoordinates());
operations.delete(DeleteQuery.builder(Query.findAll()).build(), entityClass, getIndexCoordinates());
return null;
});
}
Expand Down