Mapping rules

The Elasticsearch document is in JavaScript Object Notation (JSON) format. In JSON, the valid datatypes are string, number, JSON object, array, Boolean, and null. The JSON data value and the mapping rules will determine the final datatype of the document field. The following table describes the mapping rules:

JSON datatype

Value

Setting in mapping

Mapped datatype

string

string

text

date

date_detection=true

date

integer

numeric_detection=true

long

floating point

numeric_detection=true

float

number

integer

long

floating point

float

JSON object

object

array

supported data type

Datatype of the first element

boolean

true/false

Boolean

null

Get Advanced Elasticsearch 7.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.