Closed psramkumar closed 5 years ago
@psramkumar Can you point me to the docs for what you are describing. I've not heard of deleting in bulk with a query
in bulk operations, you have to always as far as i know provide a NDJSON structured blob https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
check for this line in the link you provided, it says The possible actions are index, create, delete and update. index and create exp ...
what is that delete mean in this document.
To delete the given record, as you'd guess - did you try any of the examples in elastic::docs_bulk
i do not see any Example provided for bulk Delete in El Document
the examples in this package we are talking about here right now - in R, go to the help page, by running ?elastic::docs_bulk
I don't think docs_bulk
currently supports delete
or update
, only index
. See https://github.com/ropensci/elastic/blob/master/R/docs_bulk_utils.R#L9
metadata_fmt <- if (es_ids) {
'{"index":{"_index":"%s","_type":"%s"}}'
} else {
if (is.character(counter)) {
'{"index":{"_index":"%s","_type":"%s","_id":"%s"}}'
} else {
'{"index":{"_index":"%s","_type":"%s","_id":%s}}'
}
}
@pieterprovoost right, thanks for pointing that out.
you can create your own file with bulk operations and use that with docs_bulk - but no way to do from a data.frame or list at the moment.
I've toyed with allowing to set different operations with data.frame or list input https://github.com/ropensci/elastic/issues/169 but no progress yet
done
curl -XDELETE $elastic_search_index_url/_query -d '{ "query" : { "bool": { "must_not": [ { "term": { "createDate": "'$current_date'" } } ] } }}'
i would like to do the above Operation, to Delete n number of rows. please guide me the possibility,
Note: as the Document says docs_bulk is used for all CURD in bulk.