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
_doc is a mapping type, which by the way is now deprecated.
A mapping type used to be a separate collection inside the same index. E.g. a twitter index could have a mapping of type user for storing all users, and a mapping of type tweet to store all tweets. Both of these types still belong to the same index, so you could search inside multiple types in the same index.
Since elaticsearch came out with the news to deprecate mapping types for several reasons, they forced v6 users to ONLY use 1 mapping type per index i.e. you can have either user or tweet inside the twitter index, but not both. They further recommended to be consistent and use _doc as the name of the mapping type. But this can literally be any string - dog, cat, etc. It is just recommended to be _doc because in v7 the mapping type field is completely going away. So if every index in elasticsearch only has 1 mapping type, then it would be easier to migrate to v7 because you just have to remove the mapping type and all documents would then directly come under the index.