记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。

elastic stack7.10新建索引并添加映射mappings信息。


如下:

PUT /it

{
"settings": {
"index": {
"number_of_shards": "2",
"number_of_replicas": "1"
}
},
"mappings": {
"properties": {
"name": {
"type": "text"
},
"age": {
"type": "integer"
},
"mai1": {
"type": "keyword"
},
"hobby": {
"type": "text"
}
}
}
}


rest接口返回信息如下:

{
"acknowledged": true,
"shards_acknowledged": true,
"index": "idd"
}


表明索引创建完成.

查看索引信息如下:

GET /it/


{
"idd": {
"aliases": {},
"mappings": {
"properties": {
"age": {
"type": "integer"
},
"hobby": {
"type": "text"
},
"mai1": {
"type": "keyword"
},
"name": {
"type": "text"
}
}
},
"settings": {
"index": {
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"number_of_shards": "2",
"provided_name": "idd",
"creation_date": "1617783828437",
"number_of_replicas": "1",
"uuid": "6b3kOxZgThKmpkkaR8aj1Q",
"version": {
"created": "7100299"
}
}
}
}
}



转载请标明出处【elastic stack7.10新建索引并添加映射mappings信息】。

《www.92cto.com》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论