python elasticsearch_python 使用 elasticsearch 常用方法(检索)

#清楚数据

curl-XDELETE http://xx.xx.xx.xx:9200/test6

#初始化数据

curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/1' -d '{"name": "tom", "age":18, "info": "tom"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/2' -d '{"name": "jack", "age":29, "info": "jack"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/3' -d '{"name": "jetty", "age":18, "info": "jetty"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/4' -d '{"name": "daival", "age":19, "info": "daival"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/5' -d '{"name": "lilei", "age":18, "info": "lilei"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/6' -d '{"name": "lili", "age":29, "info": "lili"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/7' -d '{"name": "tom1", "age":30, "info": "tom1"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/8' -d '{"name": "tom2", "age":31, "info": "tom2"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/9' -d '{"name": "tom3", "age":32, "info": "tom3"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/10' -d '{"name": "tom4", "age":33, "info": "tom4"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/11' -d '{"name": "tom5", "age":34, "info": "tom5"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/12' -d '{"name": "tom6", "age":35, "info": "tom6"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/13' -d '{"name": "tom7", "age":36, "info": "tom7"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/14' -d '{"name": "tom8", "age":37, "info": "tom8"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/15' -d '{"name": "tom9", "age":38, "info": "tom9"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/16' -d '{"name": "john", "age":38, "info": "john"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/17' -d '{"name": "marry", "age":38, "info": "marry and john are friend"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/18' -d '{"name": "john", "age":32, "info": "john"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/19' -d '{"name": "tom is a little boy", "age":7, "info": "tom is a little boy"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/20' -d '{"name": "tom is a student", "age":12, "info": "tom is a student"}'curl-H "Content-Type: application/json" -XPUT 'http://xx.xx.xx.xx:9200/test6/user/21' -d '{"name": "jack is a little boy", "age":22, "info": "jack"}'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值