window下使用curl操作elasticsearch


 

1.下載curlzip,https://curl.haxx.se/download.html;

2.解壓,在bin文件夾中找到curl.exe,右鍵“以管理員身份運行”,cmd e: 換盤符;出現E:\Work\curl-7.46.0-win64\curl-7.46.0-win64\bin;

3.curl localhost:9200/

查詢集群的健康狀態

curl localhost:9200/_cat/health?v

查詢結點的列表 

curl localhost:9200/_cat/nodes?v

 

查看所有的索引:

curl localhost:9200/_cat/indices?v

 

 創建索引:

curl -XPUT localhost:9200/customer?pretty

 

設置類型type,\",斜杠加雙引號

curl -XPUT localhost:9200/customer/external/1?pretty -d "{\"name\":\"Fred\"}"

 

查詢:

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

刪除索引:

curl -XDELETE localhost:9200/customer?pretty

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM