04 curl 操作elasticsearch的CRUD

查看健康状态

curl -X GET 127.0.0.1:9200/_cat/health?v

查询当前es集群中所有的indices

curl -X GET 127.0.0.1:9200/_cat/indices?v

创建索引

curl -X PUT 127.0.0.1:9200/www

删除索引

curl -X DELETE 127.0.0.1:9200/www

插入记录

curl -H "Content-Type:application/json" -X POST 127.0.0.1:9200/user/person -d '
{
	"name": "dsb",
	"age": 9000,
	"married": true
}'

输出:

{"_index":"user","_type":"person","_id":"55GiOH4BfTVguARX3JmZ","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}

上一篇:JavaEE 请求转发和响应重定向


下一篇:09夯实基础之JavaEE基础