es basic concepts Summary - dynamic mapping

1. Mapping mapping

effect:

  • Field Name Data type definitions and
  • Definition of inverted index (if indexed, using the analyzer

Examples

PUT data/_doc/1 
{ "count": 5, "date": "2015/09/02" }

GET data/_mapping

Creating a data index, map type _doc, field data type long count

{
  "data" : {
    "mappings" : {
      "properties" : {
        "count" : {
          "type" : "long"
        },
        "date" : {
          "type" : "date",
          "format" : "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||epoch_millis"
        }
      }
    }
  }
}

 

2. Dynamic Field Mapping

Date of detection (enabled by default)

 Disable

PUT my_index
{
  "mappings": {
    "date_detection": false
  }
}

 Custom mapping format

PUT my_index
{
  "mappings": {
    "dynamic_date_formats": ["MM/dd/yyyy"]
  }
}

Digital detection (disabled by default)

PUT my_index
{
  "mappings": {
    "numeric_detection": true
  }
}

PUT my_index/_doc/1
{
  "my_float":   "1.0", 
  "my_integer": "1" 
}

 

233

Reference material


 

https://www.elastic.co/guide/en/elasticsearch/reference/7.6/dynamic-mapping.html

Guess you like

Origin www.cnblogs.com/lemos/p/12508723.html