这是在kibana中最简单的添加方式
PUT index/_mapping
{
"properties":{
"new_field":{"type" : "keyword"}
}
}
嵌套文档添加新字段
PUT index/_mapping
{
"properties": {
"new_field": {
"type":"nested",
"properties": {
"certId": {
"type": "keyword"
}
}
}
}
}
添加 ik 分词字段
PUT index/_mapping
{
"properties": {
"new_field": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
添加新的嵌套字段
PUT your_index/_mapping
{
"properties": {
"new_nested_field": {
"type": "nested",
"properties": {
"field_1": {
"type": "keyword"
},
"field_2": {
"type": "keyword"
},
"field_3": {
"type": "text" ,
"search_analyzer":"standard",
"analyzer":"autocomplete"
},
"field_4": {
"type": "date"
},
"field_5": {
"type": "text",
"fields": {
"ik": {
"type": "text",
"analyzer": "ik_max_word"
}
}
}
}
}
}
}