ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

windows系统下执行es的curl

2022-08-15 12:32:56  阅读:230  来源: 互联网

标签:http 9200 windows testindex localhost curl type es


windows系统下执行curl:

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

查看es状态
curl http://localhost:9200/_cat/health


查看特定索引
curl "http://localhost:9200/_cat/indices/testindex"


删除索引
curl -X DELETE "http://localhost:9200/testindex"


新建索引
curl -H "Content-Type: application/Json" -X PUT "http://localhost:9200/testindex" -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/testindex/_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/testindex/_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/testindex/testbundlesku/410c4e4e-768d-4c82-abf8-57d3123df956"


新增或修改数据
curl -H "Content-Type: application/Json" -XPUT "http://localhost:9200/testindex/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/testindex/_search" -d "{\"from\":0,\"size\":2}"

 

标签:http,9200,windows,testindex,localhost,curl,type,es
来源: https://www.cnblogs.com/caihuaxing/p/16587862.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有