In this section we will look at how to perform basic CRUD operations, which are the most fundamental operations required by any data store. Elasticsearch has a very well designed REST API, and the CRUD operations are targeted at documents.
To understand how to perform CRUD operations, we will cover the following APIs. These APIs fall under the category of Document APIs that deal with documents:
- Index API
- Get API
- Update API
- Delete API
In Elasticsearch terminology, adding (or creating) a document into a type within an index of Elasticsearch is called an indexing operation. Essentially, it involves adding the document to the index by parsing all fields within the document and building the inverted index. This is why this operation is known as an indexing operation.
There are two ways we can index a document:
- Indexing a document by providing an ID
- Indexing a document without providing an ID