There's more...
The GET API is very fast, so a good practice when developing applications is to try and use it as much as possible. Choosing the correct ID form during application development can bring a big boost in performance.
If the shard, which contains the document, is not bound to an ID, a query with an ID filter (we will see them in Chapter 6, Text and Numeric Queries, in the Using an IDS query recipe) is required to fetch the document.
If you don't need to fetch the record, and only want to check for its existence, you can replace GET with HEAD, and the response will be status code 200 if it exists, or 404 if it is missing.
The GET call also has a special endpoint, _source, that allows for the fetching of only the source of the document.
The GET source REST API URL is as follows:
http://<server>/<index_name>/_doc/<id>/_source
To fetch the source of the previous order, we will call the following:
GET /myindex/_doc/2qLrAfPVQvCRMe7Ku8r0Tw/_source