curl -X GET "localhost:9200/_cat/health?v"
curl -X GET "localhost:9200/_cat/nodes?v"
curl -X GET "localhost:9200/_cat/indices?v"
使用PUT谓词创建一个名为 customer
的索引
curl -X PUT "localhost:9200/customer?pretty"
再次查看索引:
curl -X GET "localhost:9200/_cat/indices?v"
curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H ‘Content-Type: application/json‘ -d‘
{
"name": "John Doe"
}
‘
查询文档:
curl -X GET "localhost:9200/customer/_doc/1?pretty"
使用谓语动词 DELETE
删除一个索引
curl -X DELETE "localhost:9200/customer?pretty"
再次查看索引:
curl -X GET "localhost:9200/_cat/indices?v"
Elasticsearch 入门 - Exploring Your Cluster
原文:https://www.cnblogs.com/gebilaowangpython/p/10422851.html