Deleting document by field content

Use this API to delete documents that contain the values listed in a specific field. These values are passed as parameters.

Requirement: OpenSearchServer v1.5

Call parameters

URL: /services/rest/index/{index_name}/document/{field_name}/{value1}/{value2}/...

Method: DELETE


  • Accept (optional returned type): application/json OR application/xml

URL parameters:

  • index_name (required): The name of the index.
  • field_name (required): The name of the field used to identify the documents to delete.
  • value (required): A list of values.

Success response

The document has been deleted.

HTTP code:

Content (application/json):

    "successful": true,
    "info": "2 document(s) deleted by my_field"

Error response

The deletion failed. The reason is provided in the content.

HTTP code:
404, 500

Field not found: my_field

Sample call

Using CURL:

curl -XDELETE \  

View/edit on GitHub

comments powered by Disqus