PUT /es_medias/_mapping/esmedias
{
"properties": {
"mediaTag": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart"
}
}
}
es7之后
PUT /social_post_info_facebook/_mapping
{
"properties": {
"userName": {
"type": "keyword"
}
}
}
动态index新增字段的默认数据类型
PUT /es_medias/_mapping/esmedias
{
"dynamic_templates": [
{
"date_default": {
"match": "*Date",
"match_mapping_type": "string",
"mapping": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
}
}
},
{
"notanalyzeds": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
]
}