I am still trying to figure out what does _doc represents in elasticsearch? From the documentation, two places I could find it\'s usage are:
While in sortin
I believe these two use cases are not using the _doc terminology for the same purpose:
The keyword _doc for sorting is new in Elasticsearch 2 and is a replacement for the old scan and scroll way to efficiently paginate deep into the results of a query. There is no actual _doc field in the documents.
The _doc syntax to be used in the _source portion of a search (or get, update, etc) request has not been implemented as shown at the beginning of that git discussion, but using the fielddata_fields field instead. It has nothing to do with the usage of _doc in sorting.
In the scripting documentation you'll find a section about document field data, that is extremely fast to read as it is stored in memory and is accessible using a similar doc syntax (that might add to the confusion).