windows系统下执行es的curl

windows系统下执行curl:

注意:windows下不能用单引号,必须用双引号,英文双引号,双引号!!!

查看es状态

curl http://localhost:9200/_cat/index

查看特定索引

curl "http://localhost:9200/_cat/indices/index"

删除索引

curl -X DELETE "http://localhost:9200/index"

新建索引

curl -H "Content-Type: application/Json" -X PUT "http://localhost:9200/index" -d "{\"mappings\" : {\"market_api\" : {\"properties\" : {\"prop_1\" : {\"type\" : \"keyword\"},\"prop_2\" : {\"type\" : \"double\"},\"prop_3\" : {\"type\" : \"keyword\"},\"prop_4\" : {\"type\" : \"integer\"}}}}}"

新增嵌套字段

curl -XPOST "http://localhost:9200/index/_mapping/testbundlesku" -H "Content-Type: application/Json" -d "{"""properties""":{"""platformSkuList2""":{"""type""":"""nested""","""properties""":{"""id""":{"""type""":"""keyword"""},"""created""":{"""type""":"""date"""}}}}}"
curl -X POST "http://localhost:9200/index/_mapping/testbundlesku" -H "Content-Type: application/Json" -d "{\"properties\":{\"platformSkuList3\":{\"type\":\"nested\",\"properties\":{\"id\":{\"type\":\"keyword\"},\"created\":{\"type\": \"date\"}}}}}"

删除数据

curl -X DELETE "http://localhost:9200/index/testbundlesku/410c4e4e-768d-4c82-abf8-57d3123df956"

新增或修改数据

curl -H "Content-Type: application/Json" -XPUT "http://localhost:9200/index/testbundlesku/13BA72ED-26DF-4D03-8A5B-BEC1D3129B28" -d" {\"id\":\"13BA72ED-26DF-4D03-8A5B-BEC1D3129B28\",\"code\":\"asdfadf\",\"newProductPlatformInfoList\":[{\"platformType\":0,\"audited\":\"2022-08-15\"},{\"platformType\":1,\"audited\":\"2022-08-01\"}]}"

查询数据

curl -H "Content-Type: application/Json" -X GET "http://localhost:9200/index/_search" -d "{\"from\":0,\"size\":2}"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值