CRUD groups the basic operations for stored Elasticsearch documents: create, read, update, and delete. Single-document APIs target one document, while multi-document APIs handle sets of documents in one request. section 5.1.1 section 5.8
A document ID identifies a document for its lifetime, much like a relational primary key. Index a document with a client-provided ID using PUT; omit the ID and use POST, which assigns a generated UUID. section 5.1.1 section 5.8
Create a movie with a known ID
Use PUT when the application chooses the identity. The index name, _doc endpoint, and final path segment identify where the movie is stored and which document it is. section 5.1.1
Listing 5.1 Indexing a new document into the movies index
PUT movies/_doc/1 #1
{ #2
"title":"The Godfather",
"synopsis":"The aging patriarch of an organized crime dynasty transfers
control of his clandestine empire to his reluctant son"
}
This request creates or indexes The Godfather document at ID 1 in the movies index. section 5.1.1
For safer creation, use _create: it returns an error when the ID already exists instead of overriding the document. Retrieve several known documents with _mget, perform grouped indexing, deletion, or updates with _bulk, and use _update or _update_by_query to modify documents. Delete one document with DELETE or many with _delete_by_query. section 5.1.1 section 5.8
CRUD has storage and operational consequences: indexed documents first reside in a shard’s in-memory buffer, then refresh into segments that Lucene later merges. Reindexing transfers data from a source index to a destination index. section 5.8










