liveBook · Manning

Schema-less feature

As explained in Elasticsearch in Action, Second Edition

A schema-free feature permits data to be indexed without an explicitly defined schema.

A schema-less feature lets Elasticsearch index JSON documents before a schema has been explicitly defined. Elasticsearch examines field values and derives their data types implicitly, helping developers start quickly. section 3.2.1 section 4.0

Indexing a movie document

A movie document can contain a title and synopsis as text, a release date as a date, and gross earnings as a floating-point value. These fields can be indexed without first defining a schema; Elasticsearch infers their types from the data. section 4.0

Use the feature with these operational considerations:

  • Use schema-less indexing during testing and development to get data into Elasticsearch quickly. section 3.2.1 section 4.0
  • Prefer an explicit mapping in production unless the requirements do not need one, because inferred choices can become problematic. section 3.2.1 section 4.0
  • Define mappings when fields need deliberate treatment for full-text analysis, sorting, filtering, or aggregations. section 4.0

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains implicit type inference and mapping consequences, but stops short of detailed mapping API procedures.
Examples
Uses movie documents containing titles, synopses, release dates, and gross earnings to illustrate inferred field types.
What it assumes
Assumes basic JSON documents and field values, while teaching schema inference and the purpose of mapping from the beginning.
What you can do after
Operate Elasticsearch by indexing JSON documents without first defining a schema, then evaluate when explicit mapping is safer.
How it connects
Connects schema-less indexing to documents, mapping, data types, full-text analysis, sorting, filtering, and aggregations.

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.