1、创建索引语法
PUT /index
{
"settings": {...},
"mappings": {
"type_one" : {...},
"type_two" : {...}
...
}
}
例如:
PUT /my_index
{
"settings": {
"number_of_shards": 2,
"number_of_replicas": 0
},
"mappings": {
"my_type" : {
"properties": {
"my_field" : {
"type": "text"
}
}
}
}
}
2、修改索引
将shard副本从0变成1
PUT /my_index/_settings
{
"number_of_replicas": 1
}
3、删除索引
DELETE /my_index
DELETE /index_one,index_two
DELETE /index_*
DELETE /_all
若有兴趣,欢迎来加入群,【Java初学者学习交流群】:458430385,此群有Java开发人员、UI设计人员和前端工程师。有问必答,共同探讨学习,一起进步!
欢迎关注我的微信公众号【Java码农社区】,会定时推送各种干货:
qrcode_for_gh_577b64e73701_258.jpg
网友评论