Learn R Programming

elastic (version 0.7.8)

docs_delete: Delete a document

Description

Delete a document

Usage

docs_delete(index, type, id, refresh = NULL, routing = NULL,
  timeout = NULL, version = NULL, version_type = NULL,
  callopts = list(), ...)

Arguments

index

(character) The name of the index. Required

type

(character) The type of the document. Required

id

(numeric/character) The document ID. Can be numeric or character. Required

refresh

(logical) Refresh the index after performing the operation

routing

(character) Specific routing value

timeout

(character) Explicit operation timeout, e.g,. 5m (for 5 minutes)

version

(character) Explicit version number for concurrency control

version_type

(character) Specific version type. One of internal or external

callopts

Curl args passed on to DELETE

...

Further args to query DSL

References

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html

Examples

Run this code
# NOT RUN {
if (!index_exists("plos")) {
 plosdat <- system.file("examples", "plos_data.json", package = "elastic")
 docs_bulk(plosdat)
}

# delete a document
docs_get(index='plos', type='article', id=36)
docs_delete(index='plos', type='article', id=36)
# docs_get(index='plos', type='article', id=36) # and the document is gone
# }

Run the code above in your browser using DataLab