首页 > 其他 > 详细

Elasticsearch 入门 - Exploring Your Cluster

时间:2019-02-23 15:59:24      阅读:162      评论:0      收藏:0      [点我收藏+]

The REST API

Cluster Health ( http://localhost:9200/

curl -X GET "localhost:9200/_cat/health?v"

List Nodes

curl -X GET "localhost:9200/_cat/nodes?v"

List All Indices

curl -X GET "localhost:9200/_cat/indices?v"

Create an Index

使用PUT谓词创建一个名为 customer 的索引

curl -X PUT "localhost:9200/customer?pretty"

再次查看索引:

curl -X GET "localhost:9200/_cat/indices?v"

Index and Query a Document

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 an Index

使用谓语动词 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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!