ElasticSearch Restfull API 建立、删除索引

1.建立索引

请求地址:put  http://127.0.0.1:9200/haokejson

注意 content-type:  application/json; app

参数:spa

{
    "settings": {
        "index": {
            "number_of_shards": "2",
            "number_of_replicas": "0"
        }
    }
}

说明:code

"number_of_shards": "2", #分片数
"number_of_replicas": "0" #副本数

结果:blog

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

在elsticsearch-head中刷新查看索引索引

 

2.删除索引

请求 DELETE  http://127.0.0.1:9200/haokeio

结果:class

{"acknowledged":true}

elsticsearch-head:请求

相关文章
相关标签/搜索