Skip to content

Commit

Permalink
Core: deprecate delete-by-query
Browse files Browse the repository at this point in the history
This API is trappy: it secretly does a refresh, which can quickly
cause too many segments / OOME if you are also concurrently indexing,
and it might delete different documents between primary and replica.

It will be removed in 2.0.

It's better to do a scan/scroll request with the query, gather the
matching ids, and issue a bulk request to delete them.

Closes #10083
  • Loading branch information
mikemccand committed Mar 13, 2015
1 parent e5889a2 commit 4ceb563
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/java-api/delete-by-query.asciidoc
@@ -1,6 +1,8 @@
[[delete-by-query]]
== Delete By Query API

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.]

The delete by query API allows one to delete documents from one or more
indices and one or more types based on a <<query-dsl-queries,query>>. Here
is an example:
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/docs/delete-by-query.asciidoc
@@ -1,6 +1,8 @@
[[docs-delete-by-query]]
== Delete By Query API

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.]

The delete by query API allows to delete documents from one or more
indices and one or more types based on a query. The query can either be
provided using a simple query string as a parameter, or using the
Expand Down

0 comments on commit 4ceb563

Please sign in to comment.