elasticsearch 7.X data type

Posted by ginoitalo on Thu, 06 Jan 2022 03:19:37 +0100

reference resources

binary

Binary values are encoded as Base64 strings.

PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "binary":{
         "type":"binary"
       }
    }
  }
}
POST es_field_type/_doc
{
  "binary":"U29tZSBiaW5hcnkgYmxvYg=="
}

boolean Boolean

true and false.

keyword whole word

The string cannot be segmented, and the query speed is fast

wildcard whole word matching

The wildcard field type is a specialized keyword field for unstructured machine-generated content that you plan to search using grep like wildcards and regexp queries.

#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"wildcard"
       }
    }
  }
}

POST es_field_type/_doc
{
  "fieldName":"keyword"
}

GET es_field_type/_search
{
  "query": {
    "wildcard": {
      "fieldName": {
        "value": "*yw*"
      }
    }
  }
}

constant_keyword constant

Set constant value and cannot be modified
If value is not set, the first inserted value is taken as a constant

#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"keyword"
       },
       "level": {
        "type": "constant_keyword",
        "value": "debug"//If value is not set, the first inserted value is taken as a constant
      }
    }
  }
}

After debug is set for level, the level of inserted data must be equal to debug, otherwise an error will be reported
"[constant_keyword] field [level] only accepts values that are equal to the value defined in the mappings [debug], but got [info]"

Number value

  • long
  • integer
  • short
  • byte
  • double
  • float

Date date

The date format can be customized, but if no format is specified, the default format is used:

"strict_date_optional_time||epoch_millis"

You can use | to separate multiple formats as separators. Each format will be tried in turn until a matching format is found. The first format will be used to convert milliseconds from time to a string.
Format format

Alias alias

  • Must be a specific field, not an object or another field alias.
  • The target field must already exist.
  • If a nested object is defined, the field alias must have the same nested scope as its target.
  • A field alias can only have one target.
  • Cannot insert data
  • Cannot be used in '_source'
#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"text"
       },
       "str":{
         "type": "alias",//Specify alias type
         "path": "fieldName" //Specify alias source (must exist)
       }
    }
  }
}

POST es_field_type/_doc
{
  "fieldName":"2015-01-01"
}

GET es_field_type/_search
{
  "query": {
    "match": {
      "str": "2015"
    }
  }
}

object format type

This format is mainly used for nesting by using properties in the mapping mode. When inserting, it can be inserted by using json according to the object name

PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"text"
       },
       "obj":{
          "properties": {
            "name":{
              "type":"text"
            },
            "age":{
              "type":"integer"
            }
          }
       }
    }
  }
}

POST es_field_type/_doc
{
  "fieldName":"2015-01-01",
  "obj":{
    "name":"zhangsan",
    "age":14
  }
}

flattened (free JSON)

At present, the object field of flattened can be used with the following query types:

  • term, terms, and terms_set
  • prefix
  • range
  • match and multi_match
  • query_string and simple_query_string
  • exists
#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"flattened"
       }
    }
  }
}

POST es_field_type/_doc
{
  "fieldName":{
    "name":"zhangsan",
    "age":15
  }
}

GET es_field_type/_search
#Query method 1: query directly by value
GET es_field_type/_search
{
  "query": {
    "term": {
      "fieldName": {
        "value": "zhangsan"
      }
    }
  }
}
#Query method 2 direct nested field query
GET es_field_type/_search
{
  "query": {
    "term": {
      "fieldName.name": {
        "value": "zhangsan"
      }
    }
  }
}


Nested nested type

index.mapping.nested_fields.limit
The maximum number of different nested mappings in the index. Nested types should only be used in special cases, that is, you need to query object arrays independently of each other. To prevent poorly designed mappings, this setting limits the number of unique nested types per index. The default is 50.
In the previous example, for this limitation, the user mapping will only count as 1.

index.mapping.nested_objects.limit
The maximum number of nested JSON objects that a single document can contain for all nested types. This limit helps prevent out of memory errors when a document contains too many nested objects. The default is 10000.

#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"nested"//Aggregation cannot be used without setting object content
       },
       "student":{
         "type":"nested",
         "properties": {
           "name":{"type":"keyword"},
           "age":{"type":"integer"}
         }
       }
    }
  }
}

POST es_field_type/_doc
{
  "fieldName":{
    "title":"qweert",
    "type":"OA"
  },
  "student":[
    {"name" : "Zhang San","age":15},
    {"name" : "Li Si","age":18}
  ]
}

GET es_field_type/_search
#Query method
GET es_field_type/_search
{
  "query": {
    "nested": {
      "path": "student",
      "query": {
        "match": {
          "student.name": "Zhang San"
        }
      },
      "inner_hits": {//You can highlight matching nested documents
        "highlight": {}
      }
    }
  }
}

GET es_field_type/_search
{
  "size":0,
  "aggs": {
    "aggName": {
      "nested": {
        "path": "student"
      },
      "aggs":{//aggs is in aggName
        "aggname1":{
          "terms": {
            "field": "student.name"
          }
        }
      }
    }
    
  }
}
#Delete data
POST es_field_type/_doc/1/_update
{
  "script":{
    "lang": "painless",
    "source": """
      ctx._source.student.removeIf(it->it.name=="Zhang San")
    """
  }
}

#Add data
POST es_field_type/_doc/1/_update
{
  "script":{
    "lang": "painless",
    "source": """
      ctx._source.student.add(params.obj)
    """,
    "params": {
      "obj":{
        "name":"Wang 5",
        "age":555
      }
    }
  }
}

#Modify data
POST es_field_type/_doc/1/_update
{
  "script":{
    "source": """
     for(e in ctx._source.student){
       if(e.name=="Li Si"){
         e.age=999
       }
     }
    """
  }
}


join document parent-child relationship

Join allows us to create a parent/child relationship

If your data needs to be updated frequently and has a performance impact, the join data type may be your solution at this time.

The join data type can completely separate the two object s, but still maintain the previous relationship between the two.

  • parent and child are two completely separate documents
  • The parent can be updated separately without re indexing the child
  • Children can be added / modified / deleted arbitrarily without affecting parent s and other children

Create index

In relations hips, we specify that fruit is the parent document, and the child documents are ["apple", "banana", "pitaya", "orange"],
And it is equivalent to standardizing the scope of the sub text

#Creating mapping
PUT /es_field_type?pretty=true
{
  "settings": {
    "number_of_replicas": 2,
    "number_of_shards": 2
  }, 
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"join",
          "relations":{
            "Fruits":["Apple","Banana","pitaya","orange"]
          }
       },
       "idx":{
         "type":"integer"
       }
    }
  }
}

routing is mandatory because parent and child files must be indexed on the same slice. Corresponds to "paren"1 "
Specify the parent document ID of this child document: 1.

#Define parent document
POST es_field_type/_bulk?refresh
{ "index":  { "_index": "es_field_type","_id":"1"}}
{"fieldName":{"name":"Fruits"},"idx":1}
{ "index":  { "_index": "es_field_type","_id":"2"}}
{"fieldName":{"name":"Fruits"},"idx":2}
#create subdocument
POST es_field_type/_bulk?routing=1
{ "index":  { "_index": "es_field_type","_id":"3"}}
{"fieldName":{"name":"Apple","parent":"1"},"idx":3}
{ "index":  { "_index": "es_field_type","_id":"4"}}
{"fieldName":{"name":"Banana","parent":"1"},"idx":4}
{ "index":  { "_index": "es_field_type","_id":"5"}}
{"fieldName":{"name":"pitaya","parent":"1"},"idx":5}
{ "index":  { "_index": "es_field_type","_id":"6"}}
{"fieldName":{"name":"Grapefruit","parent":"1"},"idx":6}

Here, the sub document must be the data in the parent document, otherwise an error will be reported
"unknown join name [grapefruit] for field [fieldName]"

has_child query

#Query parent document through child document
GET es_field_type/_search
{
  "query": {
    "has_child": {
      "type": ["Grapefruit","Apple","Banana"],//Subdocument name
      "ignore_unmapped":true,//Ignore unmapped subdocuments and report no errors to query nonexistent types
      "query": {//Screening conditions
        "match_all": {}
      }
    }
  }
}
  • max_children: the maximum number of child documents that match the query for the returned parent document. If the parent document exceeds this limit, it will be excluded from the search results.
  • min_children: the minimum number of child documents required to match the query to match the returned parent document. If the parent document does not meet this limit, it is excluded from the search results.
  • score_mode: indicates how the score of the matching child document affects the correlation score of the root parent document. Valid values:
    • none (Default)
    • avg
    • min
    • sum

has_parent

# Query child documents through parent documents
GET es_field_type/_search
{
  "query": {
    "has_parent": {
      "parent_type": "Fruits",
      "query": {
        "match_all": {}
      }
    }
  }
}

parent_id

# Query the parent document with the specified id according to the child document
GET es_field_type/_search
{
  "query": {
    "parent_id":{
      "type":"pitaya",//subdocument 
      "id":"1",//Parent document id,
      "ignore_unmapped":false//Query grapefruit ignore error
    }
  }
}

children aggregation

# children aggregate function unified parent document
GET es_field_type/_search
{
  "size":0,
  "aggs": {
    "testAggs": {
      "children": {//Aggregate function used
        "type": "Apple"  //subdocument 
      },
      "aggs": { //children peer
        "NAME": {
          "terms": {
            "field": "idx",
            "size": 10
          }
        }
      }
    }
  }
}
# Aggregate function method unified parent document
GET es_field_type/_search
{
  "size":0,
  "aggs": {
     "testAggs":{
        "terms": {
          "field": "fieldName#Fruit ",
          "size": 10
        }
     }
  }
}

Range

integer_range32-bit signed integer range. The minimum value is - 231 and the maximum value is 231-1.
float_rangeSingle precision 32-bit IEEE 754 floating point value range.
long_range64 bit signed integer range. The minimum value is - 263 and the maximum value is 263-1.
double_rangeDouble precision 64 bit IEEE 754 floating point value range.
date_rangeThe range of date values expressed as unsigned 64 bit integer milliseconds elapsed in the system era.
ip_rangeSupport the ip value range of IPv4 or IPv6 (or mixed) addresses.

The range field accepts the following parameters:

coerceTry converting a string to a number and truncating the fraction of an integer. Accept true (default) and false.
boostMapping field level query time promotion. Accept a floating point number, which defaults to 1.0.
include_in_allShould field values be included in**_ All field? Accept true or false * *. If index is set to false, or if the parent object field will include_ in_ If all is set to false, it defaults to false. Otherwise, it defaults to true.
indexShould this field be searchable? Accept true (default) and false.
storeShould the field value be the same as**_ The source field is stored and retrieved separately. Accept true or false * * (default).
#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "date_range":{  
         "type":"date_range",
         "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
       },
       "integer_range":{
         "type":"integer_range"
       }
    }
  }
}
#insert
POST es_field_type/_doc
{
  "date_range":{
    "gte":"2020-12-31",
    "lte":"2021-12-31"
  },
  "integer_range":{
    "gte":0,
    "lte":20
  }
}

#query
GET es_field_type/_search
{
  "query": {
    "term": {
      "integer_range": {
        "value": 5
      }
    }
  }
}

ip

The ip field can index / store IPv4 or IPv6 addresses.

#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
        "ipaddr":{
          "type": "ip",
          "ignore_malformed":false
        }
    }
  }
}
#insert
POST es_field_type/_doc
{
  "ipaddr":"192.168.1.1"
}

#query
GET es_field_type/_search
{
  "query": {
    "term": {
      "ipaddr": {
        "value": "192.168.1.1"
      }
    }
  }
}

Version software version

Version field type is the specialization of keyword fields, which is used to process software version values and support their specialization priority rules.
(for example: "2.1.0" < "2.4.1" < "2.11.2") and pre release versions are sorted before release versions (i.e. < "1.0.0 alpha 1.0.0").
Range queries between '1.0.0' and '1.5.0' will include '1.2.3' version, but not '1.11.2'. Note that this is different when you index with regular keyword fields sorted alphabetically.
Field parameters
1.11.0>1.9.0

#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
        "fieldName":{
          "type": "version"
        }
    }
  }
}
#insert
POST es_field_type/_bulk
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"0.0.1"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.0.0"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.1.1"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.5.1"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.5.56"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.5.99"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.9.0"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.9.13"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.11.0"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"1.11.2"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"2.0.0"}
{ "index":  { "_index": "es_field_type"}}
{"fieldName":"2.1.0"}


#query
GET es_field_type/_search
{
  "query": {
    "range": {
      "fieldName": {
        "gte": "1.6.0",
        "lte": "1.11.2"
      }
    }
  }
}

Text text type

The text field is not used for sorting, cannot be used for scripts, and cannot be aggregated
Aggregation needs to enable fielddata=true, but increase memory. Aggregation is suitable for keyword
If fielddata is not enabled, you can use the fields property to implement it

  • Analyzer: do word segmentation and insert the inverted index. At this time, the word splitter specified by analyzer may be used
  • search_analyzer: when querying, first segment the text type input to be queried, and then reverse the index search. At this time, search may be used_ Word breaker specified by analyzer
  • search_quote_analyzer: the setting allows you to specify an analyzer for phrases, which is particularly useful when dealing with stop words that disable phrase queries.
  • index_ The prefixes: parameter allows indexing of lexical prefixes to speed up prefix search.
    • min_chars: minimum prefix length of the index. Must be greater than 0, the default value is 2. The value is inclusive.
    • max_chars: maximum prefix length of the index. Must be less than 20, the default value is 5. The value is inclusive.

Completion automatic completion (with suggest)

PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
        "fieldName":{
          "type": "completion",
          "analyzer":"ik_smart"
        }
    }
  }
}
  • analyzer: index word breaker
  • search_analyzer: the search analyzer to use. The default is the value of the analyzer.
  • preserve_separators: Reserve separators. The default value is true.
  • max_input_length: limit the length of a single input. The default is 50 UTF-16 code points. This limit is only used in indexing to reduce the total number of characters per input string and prevent a large number of inputs from inflating the underlying data structure. Most use cases are not affected by default values, because prefix completion rarely exceeds a prefix of more than a few characters.

Use suggest query

#insert
POST es_field_type/_doc
{
  "fieldName":[{"input":"Mint health","weight":1}]
}
POST es_field_type/_doc
{
  "fieldName":[{"input":"Mint health 2","weight":10}]
}


POST es_field_type/_search?pretty
{
  "_source": "fieldName", //Reduce network overhead
  "suggest": {
    "YOUR_SUGGESTION": {
      "prefix": "Mint", //prefix       
      "completion": {         
          "field": "fieldName" ,
          "size":"5",
          "skip_duplicates": true,//Whether duplicate suggestions should be filtered,
          "fuzzy": {  
            "fuzziness": 60 //Fuzzy coefficient
          }
      }
    }
  }
}

parameter

boost

At query time, a single field can be automatically promoted - calculating more correlation scores

doc_values

Is this field stored on disk for later sorting, aggregation, or scripting? Accept true (default) or false.

index

The index option controls whether field values are searched. The default value is true. Fields without indexes are not queryable.

null_value

Cannot index or search for null values. When a field is set to null (or an empty array or an empty value array), it is considered that the field has no value. Value type is not allowed

{
  "mappings": {
    "properties": {
      "status_code": {
        "type":       "keyword",
        "null_value": "NULL" 
      }
    }
  }
}

Can be set to null when writing data
"status_code": null

An empty array is not considered null
"status_code": []

null data can be queried

"query": {
    "term": {
      "status_code": "NULL" 
    }
  }

exists checks for the existence of this field, and null_val feels like it's actually no different from writing a null string

GET es_field_type/_search
{
    "query": {
      "exists": {
        "field": "field"
      }
    }
}

eager_global_ordinals

The default is false, because the dictionary needs to be resident in memory and will be reconstructed after each refresh, which increases the consumption of memory and cpu. It is recommended to use it in index es with low write and high query and small amount of data.

fields

Provide different types for fields. For example, A field can implement text type, keyWord type and different word separators, which can be used for query, aggregation, etc

#Creating mapping
PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"keyword", 
         "fields": {
           "text":{ //fields name
             "type":"text", //type
             "analyzer": "standard" //Set word segmentation 
           }
         }
       }
    }
  }
}
#Add data
POST es_field_type/_doc
{
  "fieldName":"hello! elasticsearch"
}
#Query keyword (cannot be segmented)
GET es_field_type/_search
{
  "query": {
    "term": {
      "fieldName": {
        "value": "hello! elasticsearch"
      }
    }
  }
}
#Query text (segmented)
GET es_field_type/_search
{
  "query": {
    "match": {
      "fieldName.text": "hello"
    }
  }
}

ignore_above

In keyword, the length of the character index is limited, and the default is 256;

PUT /es_field_type?pretty=true
{
  "mappings":{
    "properties":{
       "fieldName":{  
         "type":"keyword", 
         "ignore_above": 2//The setting can only index 2 characters
       }
    }
  }
}

#Add data e es elastic
POST es_field_type/_doc
{
  "fieldName":"elastic"
}

In practice, only e and es are searched because elastic is out of the index range

index_options

It is used to control the contents of inverted index records

format

  • epoch_millis||epoch_second:java time milliseconds ðž“œ minutes (milliseconds / 1000)

  • date_optional_time || strict_date_optional_time: General ISO format

  • basic_date: yyyMMdd

  • basic_date_time : yyyyMMdd'T'HHmmss.SSSZ

  • basic_date_time_no_millis: yyyyMMdd'T 'HHmmssZ (no formatter for milliseconds)

  • basic_ordinal_date: a formatter for ordinal date, using a four digit year and a three digit date, yyyyDDD.

  • basic_ordinal_date_time: a formatter for complete ordinal date and time, using four digit year and three digit date: yyyyDDD'T'hhmmss SSSZ.

  • basic_ordinal_date_time_no_millis: a formatter for complete ordinal date and time without milliseconds, using four digit year and three digit date: yyyyDDD'T'HHmmssZ

  • basic_time: a formatter of two digit hours, two digit minutes, two digit seconds, three digit milliseconds and time offset: hhmmss SSSZ.

  • basic_time_no_millis: a formatter for two digit hours, two digit minutes, two digit seconds and time offset: HHmmssZ

  • basic_t_time: a two digit hour, a two digit minute, a two digit second, a three digit millisecond, and a time zone prefixed with T:'t 'hhmmss SSSZ.

  • basic_t_time_no_millis: a two digit hour, two digit minute, two digit second, and time zone prefixed with T:'t 'HHmmssZ

  • basic_week_date or strict_basic_week_date: a four digit weekyear, two digit weeks, and one digit days: xxxx'W'wwe.

  • basic_week_date_time or strict_basic_week_date_time: a formatter containing the basic weekyear date and time, divided by T: xxxx'W'wwe't'hhmmss SSSZ.

  • basic_week_date_time_no_millis or strict_basic_week_date_time_no_millis: a formatter that contains the basic weekyear date and time and does not contain milliseconds. It is divided by T 😗* xxxx’W’wwe’T’HHmmssZ**.

  • date or strict_date: a complete date formatter, four digit year, two digit month, two digit day: yyyy mm DD

  • date_hour or strict_date_hour: a formatter containing a full date and two digit hours: yyyy MM DD'T'HH

-date_hour_minute or strict_date_hour_minute: a formatter containing full date, two digit days and two digit minutes: yyyy mm dd'T'HH:mm

-date_hour_minute_second or strict_date_hour_minute_second: a full date, two digit days, two digit minutes, and two digit seconds: yyyy mm dd'T'HH:mm:ss

  • date_hour_minute_second_fraction or strict_date_hour_minute_second_fraction: a fraction containing a complete date, two digit hours, two digit minutes, two digit seconds, and three digit seconds: yyyy mm dd'T'hh: mm: SS SSS.

  • date_hour_minute_second_millis or strict_date_hour_minute_second_millis: a fraction containing a complete date, two digit hours, two digit minutes, two digit seconds, and three digit seconds: yyyy mm dd'T'hh: mm: SS SSS.

  • date_time or strict_date_time: a formatter containing the complete date and time divided by T: yyyy mm dd't'hh: mm: SS SSSZZ.

  • date_time_no_millis or strict_date_time_no_millis: a formatter with complete date and time and no milliseconds divided by T: yyyy mm dd't'HH:mm:ssZZ

  • hour or strict_hour: a formatter for two digit hours: HH

  • hour_minute or strict_hour_minute: a two digit hour and two digit minute: HH:mm

  • hour_minute_second or strict_hour_minute_second: a two digit hour, two digit minute and two digit second: HH:mm:ss

  • hour_minute_second_fraction or strict_hour_minute_second_fraction: a two digit hour, two digit minute, two digit second, three digit second fraction: HH: mm: SS SSS.

  • hour_minute_second_millis or strict_hour_minute_second_millis: a two digit hour, two digit minute, two digit second, and three digit second fraction: HH: mm: SS SSS.

  • ordinal_date or strict_ordinal_date: a full date formatter that uses four digit years and three digit days: yyyy DDD

  • ordinal_date_time or strict_ordinal_date_time: a full ordinal date and time formatter, using four digit years and three digit days: yyyy ddd'T'hh: mm: SS SSSZZ.

  • ordinal_date_time_no_millis or strict_ordinal_date_time_no_millis: a formatter with complete date and time without milliseconds, using four digit year and three digit year days: yyyy DDD'T'HH:mm:ssZZ

  • time or strict_time: a two digit day, two digit hour, two digit second, three digit second fraction, and time offset: HH: mm: SS SSSZZ.

  • time_no_millis or strict_time_no_millis: a two digit hour, two digit minute, two digit second, and time offset: HH:mm:ssZZ

  • t_time or strict_t_time: a two digit hour, a two digit minute, a two digit second, a three digit second fraction, and a time offset prefixed with T:'t 'HH: mm: SS SSSZZ.

  • t_time_no_millis or strict_t_time_no_millis: a two digit hour, two digit minute, two digit second, and time offset prefixed with T:'t 'HH:mm:ssZZ

  • week_date or strict_week_date: a complete formatter, four digit weekyear, two digit weeks, and one digit days: xxxx-'W'ww-e

  • week_date_time or strict_week_date_time: a formatter containing the complete weekyear date and time, divided by T: xxxx-'W'ww-e't'hh: mm: SS SSSZZ.

  • week_date_time_no_millis or strict_week_date_time_no_millis: a formatter containing the complete weekyear date and time without milliseconds, divided by T: xxxx-'W'ww-e't'HH:mm:ssZZ

  • weekyear or strict_weekyear: formatter of a four digit weekyear: xxxx

  • weekyear_week or strict_weekyear_week: a four digit weekly and two digit weeks: xxxx-'W'ww

  • weekyear_week_day or strict_weekyear_week_day: a four digit weekyear, two digit weeks, and one digit days: xxxx-'W'ww-e

  • year or strict_year: a formatter for a four digit year: yyyy

  • year_month or strict_year_month: a formatter for a four digit year and two digit month: yyyy mm

  • year_month_day or strict_year_month_day: a four digit year and two digit month, and the formatter of two digit days: yyyy mm DD

Topics: Big Data ElasticSearch