Elasticsearch Getting Started with (ii) Mapping + field type

Source: Internet
Author: User

Elasticsearch Reference [6.2]? Mapping
Refer to the official English document Https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html

Mapping is the process of defining how a document and the fields it contains are stored and indexed, each with a mapping type that determines how the document will be indexed.

Meta-fields
Include _index,_type,_id and _source fields for documents

es field data type :
Https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html

  1. String type
    Text, keyword
  2. Numeric type
    Long, integer, short, Byte, double, float, half_float, scaled_float
  3. Date type
    Date
  4. Boolean value type
    Boolean
  5. Binary type
    Binary
  6. Range type
    Integer_range, Float_range, Long_range, Double_range, Date_range
  7. Array data type (array does not need to define a special type)

    "one","two"1,2 ][{"name":"Mary","age":12},{"name":"John","age":10}]
  8. Object data type (JSON nested)

    {   "region":"US",  "manager":{"age":     30,"name":{   "first":"John",  "last":  "Smith"}  }}
  9. Geographic data types
    Geo-point,geo-shape (more complex, refer to official website documents, generally with geo-point on it)
  10. Special data types
    IP (IPV4 and IPV6 addresses)
    Completion (auto-complete/search)
    Token_count (numeric type, parsing string, number of indexes)
    MURMUR3 (the ability to calculate the hash of field values at index time and store them in the index.) Very helpful when running cardinality aggregations on high cardinality and large string fields)
    Join (Create parent/child relationships in documents of the same index)

The following is a common parameter type definition & Assignment Demo

type parameter Definition Assign Value
Text ' name ': {' type ': ' Text '} "Name": "Zhangsan"
Keyword "Tags": {"type": "Keyword"} "Tags": "abc"
Date "Date": {"type": "Date"} "Date": "2015-01-01t12:10:30z"
Long "Age": {"type": "Long"} "Age": 28
Double "Score": {"type": "Double"} "Score": 98.8
Boolean "Isgirl": {"type": "Boolean"} "Isgirl": True
Ip "Ip_addr": {"type": "IP"} "Ip_addr": "192.168.1.1"
Geo_point "Location": {"type": "Geo_point"} "Location": {"lat": 40.12, "lon":-71.34}
Mapping parameters

Https://www.elastic.co/guide/en/elasticsearch/reference/6.2/mapping-params.html

Mapping Parameters Notes
Analyzer
Normalizer
Boost
Coerce
Copy_to
Doc_values
Dynamic
Enabled
Fielddata
Eager_global_ordinals
Format
Ignore_above
Ignore_malformed
Index_options
Index
Fields
Norms
Null_value
Position_increment_gap
Properties
Search_analyzer
Similarity
Store
Term_vector

Elasticsearch Getting Started with (ii) Mapping + field type

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.