What is a document in Elasticsearch?

Answer

A document in Elasticsearch is the basic unit of information that is indexed and searchable, analogous to a row in a relational database table. Documents are stored as JSON objects. Each document belongs to an index and has a unique _id. For example, a product document might look like {"name": "Running Shoes", "price": 59.99, "brand": "Nike"}. Documents are schema-flexible — different documents in the same index can have different fields, though this is generally discouraged for performance reasons. Documents are immutable once indexed; updating a document replaces it entirely internally.