25 lines
396 B
Plaintext
25 lines
396 B
Plaintext
.Deleting documents with a simple query
|
|
[source,js]
|
|
---------
|
|
client.deleteByQuery({
|
|
index: 'myindex',
|
|
q: 'test'
|
|
}, function (error, response) {
|
|
// ...
|
|
});
|
|
---------
|
|
|
|
.Deleting documents using the Query DSL
|
|
[source,js]
|
|
---------
|
|
client.deleteByQuery({
|
|
index: 'posts',
|
|
body: {
|
|
query: {
|
|
term: { published: false }
|
|
}
|
|
}
|
|
}, function (error, response) {
|
|
// ...
|
|
});
|
|
--------- |