Skip to content

Commit 29bfcd0

Browse files
committed
Un-deprecate delete-by-query
Closes elastic#10443
1 parent df15dea commit 29bfcd0

16 files changed

+0
-74
lines changed

docs/java-api/delete-by-query.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[[delete-by-query]]
22
== Delete By Query API
33

4-
deprecated[1.5.0, "Delete by Query will be removed in 2.0: it is problematic since it silently forces a refresh which can quickly cause OutOfMemoryError during concurrent indexing, and can also cause primary and replica to become inconsistent. Instead, use the <<search,scroll/scan API>> to find all matching ids and then issue a bulk request to delete them.]
5-
64
The delete by query API allows one to delete documents from one or more
75
indices and one or more types based on a <<query-dsl-queries,query>>. Here
86
is an example:

docs/reference/docs/delete-by-query.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[[docs-delete-by-query]]
22
== Delete By Query API
33

4-
deprecated[1.5.0, "Delete by Query will be removed in 2.0: it is problematic since it silently forces a refresh which can quickly cause OutOfMemoryError during concurrent indexing, and can also cause primary and replica to become inconsistent. Instead, use the <<search-request-scroll,scroll/scan API>> to find all matching ids and then issue a bulk request to delete them.]
5-
64
The delete by query API allows to delete documents from one or more
75
indices and one or more types based on a query. The query can either be
86
provided using a simple query string as a parameter, or using the

src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryAction.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
import org.elasticsearch.action.ClientAction;
2323
import org.elasticsearch.client.Client;
2424

25-
/**
26-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
27-
* request to delete them.
28-
*/
29-
@Deprecated
3025
public class DeleteByQueryAction extends ClientAction<DeleteByQueryRequest, DeleteByQueryResponse, DeleteByQueryRequestBuilder> {
3126

3227
public static final DeleteByQueryAction INSTANCE = new DeleteByQueryAction();

src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@
5252
* @see DeleteByQueryResponse
5353
* @see org.elasticsearch.client.Requests#deleteByQueryRequest(String...)
5454
* @see org.elasticsearch.client.Client#deleteByQuery(DeleteByQueryRequest)
55-
*
56-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
57-
* request to delete them.
5855
*/
59-
@Deprecated
6056
public class DeleteByQueryRequest extends IndicesReplicationOperationRequest<DeleteByQueryRequest> {
6157

6258
private BytesReference source;

src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequestBuilder.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131

3232
import java.util.Map;
3333

34-
/**
35-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
36-
* request to delete them.
37-
*/
38-
@Deprecated
3934
public class DeleteByQueryRequestBuilder extends IndicesReplicationOperationRequestBuilder<DeleteByQueryRequest, DeleteByQueryResponse, DeleteByQueryRequestBuilder> {
4035

4136
private QuerySourceBuilder sourceBuilder;

src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333
/**
3434
* The response of delete by query action. Holds the {@link IndexDeleteByQueryResponse}s from all the
3535
* different indices.
36-
*
37-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
38-
* request to delete them.
3936
*/
40-
@Deprecated
4137
public class DeleteByQueryResponse extends ActionResponse implements Iterable<IndexDeleteByQueryResponse> {
4238

4339
private Map<String, IndexDeleteByQueryResponse> indices = newHashMap();

src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryRequest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@
2727

2828
/**
2929
* Delete by query request to execute on a specific index.
30-
*
31-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
32-
* request to delete them.
3330
*/
34-
@Deprecated
3531
class IndexDeleteByQueryRequest extends IndexReplicationOperationRequest<IndexDeleteByQueryRequest> {
3632

3733
private final BytesReference source;

src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryResponse.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030

3131
/**
3232
* Delete by query response executed on a specific index.
33-
*
34-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
35-
* request to delete them.
3633
*/
37-
@Deprecated
3834
public class IndexDeleteByQueryResponse extends ActionResponse {
3935

4036
private String index;

src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryRequest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@
4040

4141
/**
4242
* Delete by query request to execute on a specific shard.
43-
*
44-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
45-
* request to delete them.
4643
*/
47-
@Deprecated
4844
public class ShardDeleteByQueryRequest extends ShardReplicationOperationRequest<ShardDeleteByQueryRequest> {
4945

5046
private int shardId;

src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryResponse.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@
2727

2828
/**
2929
* Delete by query response executed on a specific shard.
30-
*
31-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
32-
* request to delete them.
3330
*/
34-
@Deprecated
3531
public class ShardDeleteByQueryResponse extends ActionResponse {
3632

3733
@Override

src/main/java/org/elasticsearch/action/deletebyquery/TransportDeleteByQueryAction.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@
3838
import java.util.Set;
3939
import java.util.concurrent.atomic.AtomicReferenceArray;
4040

41-
/**
42-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
43-
* request to delete them.
44-
*/
45-
@Deprecated
4641
public class TransportDeleteByQueryAction extends TransportIndicesReplicationOperationAction<DeleteByQueryRequest, DeleteByQueryResponse, IndexDeleteByQueryRequest, IndexDeleteByQueryResponse, ShardDeleteByQueryRequest, ShardDeleteByQueryRequest, ShardDeleteByQueryResponse> {
4742

4843
private final DestructiveOperations destructiveOperations;

src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@
3535

3636
/**
3737
* Internal transport action that broadcasts a delete by query request to all of the shards that belong to an index.
38-
*
39-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
40-
* request to delete them.
4138
*/
42-
@Deprecated
4339
public class TransportIndexDeleteByQueryAction extends TransportIndexReplicationOperationAction<IndexDeleteByQueryRequest, IndexDeleteByQueryResponse, ShardDeleteByQueryRequest, ShardDeleteByQueryRequest, ShardDeleteByQueryResponse> {
4440

4541
private static final String ACTION_NAME = DeleteByQueryAction.NAME + "[index]";

src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
import org.elasticsearch.threadpool.ThreadPool;
4545
import org.elasticsearch.transport.TransportService;
4646

47-
/**
48-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
49-
* request to delete them.
50-
*/
51-
@Deprecated
5247
public class TransportShardDeleteByQueryAction extends TransportShardReplicationOperationAction<ShardDeleteByQueryRequest, ShardDeleteByQueryRequest, ShardDeleteByQueryResponse> {
5348

5449
public final static String DELETE_BY_QUERY_API = "delete_by_query";

src/main/java/org/elasticsearch/client/Client.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,7 @@ public interface Client extends ElasticsearchClient<Client>, Releasable {
226226
* @param request The delete by query request
227227
* @return The result future
228228
* @see Requests#deleteByQueryRequest(String...)
229-
*
230-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
231-
* request to delete them.
232229
*/
233-
@Deprecated
234230
ActionFuture<DeleteByQueryResponse> deleteByQuery(DeleteByQueryRequest request);
235231

236232
/**
@@ -239,20 +235,12 @@ public interface Client extends ElasticsearchClient<Client>, Releasable {
239235
* @param request The delete by query request
240236
* @param listener A listener to be notified with a result
241237
* @see Requests#deleteByQueryRequest(String...)
242-
*
243-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
244-
* request to delete them.
245238
*/
246-
@Deprecated
247239
void deleteByQuery(DeleteByQueryRequest request, ActionListener<DeleteByQueryResponse> listener);
248240

249241
/**
250242
* Deletes all documents from one or more indices based on a query.
251-
*
252-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
253-
* request to delete them.
254243
*/
255-
@Deprecated
256244
DeleteByQueryRequestBuilder prepareDeleteByQuery(String... indices);
257245

258246
/**

src/main/java/org/elasticsearch/index/engine/DeleteByQueryFailedEngineException.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121

2222
import org.elasticsearch.index.shard.ShardId;
2323

24-
/**
25-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
26-
* request to delete them.
27-
*/
28-
@Deprecated
2924
public class DeleteByQueryFailedEngineException extends EngineException {
3025

3126
public DeleteByQueryFailedEngineException(ShardId shardId, Engine.DeleteByQuery deleteByQuery, Throwable cause) {

src/main/java/org/elasticsearch/rest/action/deletebyquery/RestDeleteByQueryAction.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040

4141
import static org.elasticsearch.rest.RestRequest.Method.DELETE;
4242

43-
/**
44-
* @deprecated Delete by query will be removed in 2.0. Instead, use the scroll/scan API to find all matching IDs and then issue a bulk
45-
* request to delete them.
46-
*/
47-
@Deprecated
4843
public class RestDeleteByQueryAction extends BaseRestHandler {
4944

5045
@Inject

0 commit comments

Comments
 (0)