liveBook · Manning

Schema-less structure

As explained in Elasticsearch in Action, Second Edition

Schemaless describes a data system that can accept documents without requiring a complete schema to be defined beforehand.

A schema-less structure lets Elasticsearch accept a document without requiring a complete data schema first. It derives the schema from the first indexed document and creates the index automatically, which keeps development fast. section 2.1.3

Indexing the first book document

A PUT request indexes document ID 1 into the books index through the Elasticsearch API. No prior schema definition is required, so the first document establishes the inferred structure. For production systems, define schemas beforehand rather than relying on inference. section 2.1.3

Figure 2.7 Indexing a document in Kibana (left), and the response from Elasticsearch (right)

View the Kibana Dev Tools request and Elasticsearch response used while indexing a document. section 2.1.3

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Defines automatic schema derivation and index creation, then stops short of explaining detailed mappings or schema design.
Examples
Uses a books index, document ID 1, an HTTP PUT request, and Kibana Dev Tools.
What it assumes
Assumes familiarity with HTTP API requests and introduces schema creation through document indexing.
What you can do after
Apply it via the Elasticsearch API to index an initial document without defining a schema beforehand.
How it connects
Relates schema-less indexing to Elasticsearch, documents, indexes, and relational databases.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elasticsearch in Action, Second Edition. The section links point to the parts of the book it draws on.