es 7.x版本和之前的版本生成索引和mapping有點不同 , 具體生成方法如下:
與以往版本少了 , index類型, 總體看來比較簡便
http://es1-kanjian/person
PUT請求, json
{
"settings": {
"number_of_shards": "1",
"number_of_replicas": "0"
},
"mappings": {
"properties": {
"age": {
"type": "integer"
},
"mail": {
"type": "keyword",
"analyzer":"ik_max_word"
},
"hobby": {
"type": "text",
"analyzer": "ik_smart"
}
}
}
}