Documents are indexed—stored and made searchable—by using the index
API. But first, we need to decide where the document lives. As we just
discussed, a document’s _index, _type, and _id uniquely identify the
document. We can either provide our own _id value or let the index API
generate one for us.

The response indicates that the indexing request has been successfully created
and includes the _index, _type, and _id metadata, and a new element:
_version.

Every document in Elasticsearch has a version number. Every time a change is
made to a document (including deleting it), the _version number is
incremented. In Dealing with Conflicts, we discuss how to use the _version
number to ensure that one part of your application doesn’t overwrite changes
made by another part.

If our data doesn’t have a natural ID, we can let Elasticsearch autogenerate
one for us. The structure of the request changes: instead of using the PUT
verb (“store this document at this URL”), we use the POST verb (“store this document under this URL”).