Elasticsearch之Field datatypes

Elasticsearch支持文档中字段的多种不同数据类型:

核心数据类型

string
text and keyword
Numeric
long, integer, short, byte, double, float, half_float, scaled_float
Date
date
Date nanoseconds
date_nanos
Boolean
boolean
Binary
binary
Range
integer_range, float_range, long_range, double_range, date_range

Complex datatypes

Object
object for single JSON objects
Nested
nested for arrays of JSON objects

Geo datatypes

Geo-point
geo_point for lat/lon points
Geo-shape
geo_shape for complex shapes like polygons

Specialised datatypes

IP
ip for IPv4 and IPv6 addresses
Completion datatype
completion to provide auto-complete suggestions
Token count
token_count to count the number of tokens in a string
mapper-murmur3
murmur3 to compute hashes of values at index-time and store them in the index
mapper-annotated-text
annotated-text to index text containing special markup (typically used for identifying named entities)
Percolator
Accepts queries from the query-dsl
Join
Defines parent/child relation for documents within the same index
Rank feature
Record numeric feature to boost hits at query time.
Rank features
Record numeric features to boost hits at query time.
Dense vector
Record dense vectors of float values.
Sparse vector
Record sparse vectors of float values.
Search-as-you-type
A text-like field optimized for queries to implement as-you-type completion
Alias
Defines an alias to an existing field.
Flattened
Allows an entire JSON object to be indexed as a single field.
Shape
shape for arbitrary cartesian geometries.
Histogram
histogram for pre-aggregated numerical values for percentiles aggregations.

Arrays

在Elasticsearch中,数组不需要专用的字段数据类型。默认情况下,任何字段都可以包含零个或多个值,但是数组中的所有值必须具有相同的数据类型。

Multi-fields

为不同的目的以不同的方式索引相同的字段通常是有用的。例如,字符串字段可以映射为用于全文搜索的文本字段,也可以映射为用于排序或聚合的关键字字段。或者,您可以使用标准分析器、英语分析器和法语分析器来索引文本字段。
这就是多领域的目的。大多数数据类型通过fields参数支持多字段。

你可能感兴趣的:(Elasticsearch,elasticsearch)