elastic stack7.10新建索引并添加映射mappings信息 |
发表者:admin分类:大数据2021-04-07 16:26:34 阅读[1026] |
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.micoder.cc》
虚拟化云计算,系统运维,安全技术服务.
Tags: | [阅读全文...] |
最新评论