Learning Elastic Stack 7.0(Second Edition)
上QQ阅读APP看书,第一时间看更新

Mappings and datatypes

Elasticsearch is schemaless, meaning that you can store documents with any number of fields and types of fields. In a real-world scenario, data is never completely schemaless or unstructured. There are always some sets of fields that are common across all documents in a type. In fact, types within the indexes should be created based on common fields. Typically, one type of document in an index shares some common fields.

Relational databases impose a strict structure. In a relational database, you need to define the structure of the table with column names and datatypes for each column at the time of creating the table. You cannot insert a record with a new column or a different datatype column at runtime. 

It is important to understand the datatypes supported by Elasticsearch.