forked from jaeksoft/opensearchserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Document delete JSON
Emmanuel Keller edited this page Nov 18, 2013
·
6 revisions
Use this API to delete documents by using a JSON body.
Requirement: OpenSearchServer v1.5
URL: /services/rest/index/{index_name}/document/{field_name}
Method: DELETE
HTTP Header:
-
Content-Type (required):
application/json
URL parameters:
- index-name (required): The name of the index.
- field-name (required): The name of the field used to identify the document to delete.
RAW data: an array of values
["2","34","65"]
The documents have been deleted.
HTTP code: 200
Content (application/json):
{
"successful": true,
"info": "3 document(s) deleted by my_field"
}The deletion failed. The reason is provided in the content.
HTTP code: 404, 500
Field not found: my_field
Using CURL:
curl -XDELETE -H "Content-Type: application/json" \
http://localhost:8080/services/rest/index/my_index/document/my_field
-d '["2","34","65"]'