What is a document?
Documents in Elasticsearch are represented in JSON format. JSON objects are written in key/value pairs. A key must be a string and must always be enclosed in quotation marks. The value must be a valid JSON datatype. Keys and values are separated by colons and with the key/value pair separated by commas. A document will be associated with metadata elements during indexing operations including the given index name, the mapping type, and the document identifier.
The document identifier can be given or autogenerated. Recall that Elasticsearch has a simple hashing formula to calculate the route that routes a document to a particular shard for storage or search. The simple formula is as follows, and the default routing value ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access