Elasticsearch为文档中的字段支持多种不同的数据类型:
string
long, integer, short, byte, double, float, half_float, scaled_float
date
boolean
binary
integer_range, float_range, long_range, double_range, date_range
object for single JSON objects
nested for arrays of JSON objects
geo_point for lat/lon points
geo_shape for complex shapes like polygons
ip for IPv4 and IPv6 addresses
completion to provide auto-complete suggestions
token_count to count the number of tokens in a string
murmur3 to compute hashes of values at index-time and store them in the index
annotated-text to index text containing special markup (typically used for identifying named entities)
Accepts queries from the query-dsl
Defines parent/child relation for documents within the same index
Defines an alias to an existing field.
In Elasticsearch, arrays do not require a dedicated field datatype. Any field can contain zero or more values by default, however, all values in the array must be of the same datatype. See Arrays.
It is often useful to index the same field in different ways for different purposes. For instance, a string field could be mapped as a text field for full-text search, and as a keyword field for sorting or aggregations. Alternatively, you could index a text field with the standard analyzer, the english analyzer, and the french analyzer.
This is the purpose of multi-fields. Most datatypes support multi-fields via the fields parameter.
官网链接:
https://www.elastic.co/guide/en/elasticsearch/reference/6.5/mapping-types.html
网友评论