Dynamic mapping的机制,使得无需手动定义mappings,es会自动根据文档信息,推算出字段类型,但这也存在不好的地方,无法控制结构。
如果将Dynamic设置为true,mapping会被更新,如果设置为false,mapping 不会被更新,但信息会存储在_source中,
如果设置为Strict,文档写入失败(strict_dynamic_mapping_exception)
自带的char_filter:html_strip、mapping、pattern replacement
POST _analyze
{
"tokenizer": "keyword",
"char_filter": [
"html_strip"
],
"text": "<b>golang hello world</b>"
}
自带的Tokenizers:whitespace、standard、uax_url_email、pattern、keyword、path hierarchy,可以自定义tokenizers
GET _analyze
{
"tokenizer": "standard",
"char_filter": [
{
"type" : "pattern_replace",
"pattern" : "http://(.*)",
"replacement" : "$1"
}
],
"text" : "http://www.baidu.com"
}
自带的Token filters:lowercase、stop、synonym