es常用命令

//查询节点
curl '192.168.100.140:9200/_cat/nodes?v'
//查询索引
curl '192.168.100.140:9200/_cat/indices?v'
//创建索引
curl -XPUT '192.168.100.140:9200/customer?pretty'{"acknowledged" : true};
//插入数据
curl -XPUT '192.168.100.140:9200/customer/external/1?pretty' -d '{"name": "John Doe"}'
//删除索引
curl -XDELETE '192.168.100.140:9200/customer?pretty'


1.curl '192.168.100.140:9200/_cat/health?v'

2.curl '192.168.100.140:9200/_cat/nodes?v'

3.curl '192.168.100.140:9200/_cat/indices?v'

4.curl -XPUT '192.168.100.140:9200/customer?pretty'
curl '192.168.100.140:9200/_cat/indices?v'

5.curl -H "Content-Type: application/json" -XPUT '192.168.100.140:9200/customer/external/1?pretty' -d '
  {
          "name": "John Doe"
  }'

6.curl -XGET '192.168.100.140:9200/customer/external/1?pretty'


  curl -XPOST '192.168.100.140:9200/bank/account/_bulk?pretty' --data-binary "@data/accounts.json"
//如果表头名报错 加上这句话:-H "Content-Type: application/json"

你可能感兴趣的:(es常用命令)