1、获得集群中的节点列表:

curl 'localhost:9200/_cat/nodes?v'

2、获得所有索引:

curl 'localhost:9200/_cat/indices?v'

3、创建指定文档,并索引到指定索引和类型

#                  索引  类型
1 curl -XPUT 'localhost:9200/customer/external/1?pretty' -d ' 2 { 3 "name": "John Doe" 4 }'

4、取出指定文档

curl -XGET 'localhost:9200/customer/external/1?pretty'

5、删除指定文档

curl -XDELETE 'localhost:9200/customer/external/2?pretty' 

6、删除指定索引

curl -XDELETE 'localhost:9200/customer?pretty'

7、修改指定文档——直接使用添加的方式“-d”指定覆盖

1 curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '
2             {
3               "name": "John Doe"
4             }'

8、更新文档

1 curl -XPOST 'localhost:9200/customer/external/1/_update?pretty' -d '
2         {
3           "doc": { "name": "Jane Doe" }
4         }'

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-02-01
  • 2021-12-10
  • 2021-11-08
猜你喜欢
  • 2021-08-13
  • 2021-07-15
  • 2022-12-23
  • 2021-12-30
  • 2021-12-21
  • 2021-09-28
相关资源
相似解决方案