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:請求