liveBook · Manning

Document type

As explained in Elasticsearch in Action, Second Edition

A document type is a legacy Elasticsearch classification for documents sharing a data shape within an index.

A document type is a legacy Elasticsearch classification for JSON documents with the same data shape. A movie document could use the Movie type, while a car document could use the Car type. section 3.2.1

Relate document types to indexes as follows:

  • Store movie documents in a movies index and associate them with the Movie type. section 3.2.1
  • Store car documents in a cars index and associate them with the Car type. section 3.2.1
  • Before version 5.x, one index could contain multiple document types, including several car-related models. section 3.2.1

Legacy typed collections

A legacy application might place several car-related types in one index: Cars, PerformanceCars, CarItems, CarSales, DealerShowRooms, and UsedCars. This illustrates why older Elasticsearch APIs can expose type names alongside index names. section 3.2.1

Warning using pre-version-8 typed document indexing

Use the warning figure to recognize pre-version-8 typed document-indexing syntax and distinguish it from current Elasticsearch usage. section 3.2.1

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Defines the classification and its historical multi-type use, then stops short of detailed API treatment.
Examples
Uses Movie, Car, movies, cars, and several legacy car-related types to illustrate typed indexing.
What it assumes
Assumes JSON documents and indexes as basic terms while introducing document types before deeper index study.
What you can do after
Evaluate older typed Elasticsearch examples and recognize why document types should not guide version-8 designs.
How it connects
Connects document types with documents, JSON, indexes, and single- and multidocument APIs.

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.