Document Resource

Path : /{index name}/{type name}/{document id?}


Index a document into the search engine with the optionally specified document id. If the document contains fields called __authorized_acl_user and/or __authorized_acl_group, entitlements will be enforced. These fields should be a JSON list of user identifiers or group identifiers (respectively).


Name Value Description
parent string The id of the parent document.
root (or routing) string The id of the “root” document, if there is a grand-parent (or greater) document that this relates to.

Code Sample:

curl -X GET --user username:password -d ‘{“message”: “Hello world”} curl -X POST --user username:password -d ‘{“message”: “Hello world”} curl -X DELETE --user username:password

Success response code:

  • 200 for GET, PUT.
  • 204 WILL be returned for DELETE.
  • 201 WILL be returned for POST operations (if successful) with the new resource’s URL specified in the Location header.

GET Response:

{ "status": 200, , "_type": "test-type", "links": [ { "url": "", "rel": "self" } ], "_source": { “message”: “Helloworld” } }

POST Response:

[ { "status": "success", "_type": "test-type", "job_run_id": “...jobrunid…”, “_index”: “default” } ]

DELETE Response:

{ "status": 200, "content": [ { "status": 200, "_type": "test-type", "_index": “default”, “_version”: 1, “found”: true, “_id”: 1 } ] }

Error response code:

Error Code Reason
401 You did not provide authorization credentials.
403 The credentials you provided were incorrect or not recognized.
404 The specified document does not exist.