标签:
字符串类型被分为两种情况:full-text 和 keywords。
full-text 表示字段内容会被分析,而 keywords 表示字段值只能作为一个精确值查询。
analyzer
、boost
、doc_values
、fielddata
、fields
、ignore_above
、include_in_all
、index
、index_options
、norms
、null_value
、position_increment_gap
、store
、search_analyzer
、search_quote_analyzer
、similarity
、term_vector
数值类型包括: long, integer, short, byte, double, float 。
coerce
、boost
、doc_values
、ignore_malformed
、include_in_all
、index
、null_value
、precision_step
、store
JSON 本身并没有日期数据类型,在 ES 中的日期类型可以是:
"2015-01-01"
or "2015/01/01 12:10:30" 的字符串
long 类型的毫秒级别的时间戳
int 类型的秒级别的时间戳
日期类型默认会被转换为 UTC 并且转换为毫秒级别的时间戳的 long 类型存储。
日期类型如果不指定 format ,将会以默认格式表示。
参数:
boost
、doc_values
、format
、ignore_malformed
、include_in_all
、index
、null_value
、precision_step
、store
布尔假: false
, "false"
, "off"
, "no"
, "0"
, ""
(empty string), 0
, 0.0 。
布尔真: 任何不为假的值。
像 terms aggregation 聚合,是使用 1 和 0 来作为 key 的,key_as_string 则是用字符串 true 和 false
布尔类型的值,在 scripts 中则始终返回 1 或 0
参数:
boost
、doc_values
、index
、null_value
、store
二进制类型以 Base64 编码方式接收一个二进制值,二进制类型字段默认不存储,也不可搜索。
参数:doc_values
、store
数组类型,要求数组元素的数据类型必须一致。
"one"
, "two"
]1
, 2
]1
, [ 2
, 3
]] which is the equivalent of [ 1
, 2
, 3
]{ "name": "Mary", "age": 12 }
, { "name": "John", "age": 10 }
] 注意:对象数组中的对象元素,无法进行查询数组元素的数据类型,将会由其第一个元素的数据类型决定。
对象数组,在 ES 内部将会被转换为多值的扁平数据类型。
PUT my_index/my_type/1 { "group" : "fans", "user" : [ { "first" : "John", "last" : "Smith" }, { "first" : "Alice", "last" : "White" } ] }
{ "group" : "fans", "user.first" : [ "alice", "john" ], "user.last" : [ "smith", "white" ] }
对象类型在内部,被索引为一个简单的、扁平化的键——值对类型。
PUT my_index/my_type/1 { "region": "US", "manager": { "age": 30, "name": { "first": "John", "last": "Smith" } } }
{ "region": "US", "manager.age": 30, "manager.name.first": "John", "manager.name.last": "Smith" }
dynamic
、enabled
、include_in_all
、properties
嵌套类型是一个特殊对象类型,嵌套类型允许对对象数组的每一个元素(对象)相互独立的进行查询。
嵌套类型的文档可以:
nested
查询来查询nested
来分析以及 reverse_nested
来聚合dynamic
、include_in_all
、properties
IPV4 数据类型其实质是个 long 类型,不过其能接收一个 IPV4 地址并且将他转换为 long 类型存放。
boost
、doc_values
、include_in_all
、index
、null_value
、precision_step
、store
标签:
原文地址:http://www.cnblogs.com/licongyu/p/5487090.html