mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 04:58:50 +00:00
ba3540675a
The delete by query plugin adds support for deleting all of the documents (from one or more indices) which match the specified query. It is a replacement for the problematic delete-by-query functionality which has been removed from Elasticsearch core in 2.0. Internally, it uses the Scan/Scroll and Bulk APIs to delete documents in an efficient and safe manner. It is slower than the old delete-by-query functionality, but fixes the problems with the previous implementation. Closes #7052
43 lines
664 B
YAML
43 lines
664 B
YAML
---
|
|
"Basic delete_by_query":
|
|
- do:
|
|
index:
|
|
index: test_1
|
|
type: test
|
|
id: 1
|
|
body: { foo: bar }
|
|
|
|
- do:
|
|
index:
|
|
index: test_1
|
|
type: test
|
|
id: 2
|
|
body: { foo: baz }
|
|
|
|
- do:
|
|
index:
|
|
index: test_1
|
|
type: test
|
|
id: 3
|
|
body: { foo: foo }
|
|
|
|
- do:
|
|
indices.refresh: {}
|
|
|
|
- do:
|
|
delete_by_query:
|
|
index: test_1
|
|
body:
|
|
query:
|
|
match:
|
|
foo: bar
|
|
|
|
- do:
|
|
indices.refresh: {}
|
|
|
|
- do:
|
|
count:
|
|
index: test_1
|
|
|
|
- match: { count: 2 }
|