栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

ElasticSearch常用命令

ElasticSearch常用命令

1、检查健康状态
curl 'localhost:9200/_cat/health?v'

2、获取集群节点列表
curl 'localhost:9200/_cat/nodes?v'

3、列出所有的索引
curl 'localhost:9200/_cat/indices?v'

4、删除索引
curl -XDELETE 'localhost:9200/customer?pretty'

5、数据查询
curl -XPOST 'localhost:9200/bank/_search?pretty' -d '
  {
    "query": { "match_all": {} }
  }'

6、更新数据
curl -XPOST 'localhost:9200/customer/external/1/_update?pretty' -d '
  {
    "doc": { "name": "Jane Doe", "age": 20 }
  }'

7、删除数据
curl -XDELETE 'localhost:9200/customer/external/2?pretty'

8、插入数据
curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '
  {
           "name": "John Doe"
  }

9、更新只读状态
curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": false}'

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/751870.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号