elasticsearch7创建语法

curl -H "Content-Type: application/json" -XPOST http://node2:9200/blog/_mapping -d'
{
    
    
"properties": {
    
    
"id": {
    
    
"type": "long",
"store": "true",
"index": "true"
},
"first_name": {
    
    
"type": "text",
"store": "true",
"analyzer": "ik_max_word"
},
"about": {
    
    
"type": "text",
"store": "true",
"analyzer": "ik_max_word"
},
"interests": {
    
    
"type": "text",
"store": "true",
"analyzer": "ik_max_word"
}
}
}'
curl -H "Content-Type: application/json" -XPOST http://node2:9200/blog/_doc/2 -d '
{
    
    
"first_name" : "bin",
"age" : 33,
"about" : "I love to go rock climbing",
"interests": [ "sports", "music" ]
}'

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/yj2434/article/details/108578181
今日推荐