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"
}
}
}
}