索引创建
格式
PUT /索引/类型
{
"settings":{
配置:例如primary shard 数量,replica shard 数量
},
"mappings":{
faild类型 分词器等设置
}
}
例子
PUT /test_index
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"test_type": {
"properties": {
"test_field": {
"type": "text"
}
}
}
}
}
索引修改
例子: 修改创建好的索引的replica shard 为1
PUT /test_index/_settings
{
"number_of_replicas": 1
}
索引删除
DELETE /test_index 指定名称删除
DELETE /test_* 通配符删除
DELETE /index1,index2 指定名称删除多个
DELETE /_all 删除所有索引