版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33746789/article/details/84112232
1、创建索引
创建索引的语法
PUT /my_index
{
"settings": { ... any settings ... },
"mappings": {
"type_one": { ... any mappings ... },
"type_two": { ... any mappings ... },
...
}
}
示例
2、修改索引
PUT /my_index/_settings
{
"number_of_replicas": 1
}
3、删除索引
DELETE /my_index
DELETE /index_one,index_two
DELETE /index_*
DELETE /_all
需要修改配置文件
elasticsearch.yml
action.destructive_requires_name: true