zoukankan      html  css  js  c++  java
  • Elasticsearch基本命令

    检查集群运行情况:    GET ->   localhost:9200/_cat/health?v
    查看集群节点列表:    GET ->   localhost:9200/_cat?nodes
    查看所有指数:           GET ->   localhost:9200/_cat?indices?v
     
    创建索引:                  PUT ->  localhost:9200/index?pretty    pretty:打印JSON相应结果
    删除索引:                  DELETE ->    localhost:9200/index?pretty
    向索引中添加内容:    PUT ->   localhost:9200/inde/_doc/1?pretty    JSON数据:{"name": "WangJunce"}    //如果索引之前不存在,则自动创建索引
    向索引中添加内容(不指定ID,会自动随机生成):    POST->   localhost:9200/inde/_doc?pretty    JSON数据:{"name": "noId"}
    修改索引中某个内容: PUT ->   localhost:9200/index/_doc/1?pretty  JSON数据:{"name":"wangjunce_update"}
    更新文档:                  POST -> localhost:9200/index/_update/1?pretty    JSON数据:{"doc": {"name": "post_update", "age": "23"}}
    检索存入索引的文档: GET ->   localhost:9200/index/_doc/1?pretty
     
    批量操作索引文档:    POST -> localhost:9200/index/_bulk?pretty    JSON数据:{"index":{"_id":"1"}}{"name": "John Doe" }{"index":{"_id":"2"}}{"name": "Jane Doe" }  (最后要加/n换行,不然会报错;也可以进行修改删除等操作)
     
  • 相关阅读:
    spring配置详解
    表单重复提交解决办法
    Java 两个变量交换值
    spring @ExceptionHandler注解方式实现异常统一处理
    mybatis实战
    使用soapui调用webservice接口
    使用火狐的restclient发送http接口post及get请求
    很多网站301重定向
    邮件发布google blogger 博客
    php file取重复
  • 原文地址:https://www.cnblogs.com/gqymy/p/11125667.html
Copyright © 2011-2022 走看看