索引创建:
curl -H ‘Content-Type:application/json‘ -XPOST http://hostip:9200/indexname
curl -H ‘Content-Type:application/json‘ -XPUT http://hostip:9200/indexname
索引删除:
curl -H ‘Content-Type:application/json‘ -XDELETE http://hostip:9200/indexname
索引/类型/文档创建:
curl -H ‘Content-Type:application/json‘ -XPOST http://hostip:9200/indexname/typename -d ‘{"key":"value"}‘
文档操作:id 指定主键
文档新增: curl -H ‘Content-Type:application/json‘ -XPOST http://hostip:9200/sys_user/sys_user/id -d ‘ {"loginName":"name","password":"password"}‘
文档更新: curl -H ‘Content-Type:application/json‘ -XPUT http://hostip:9200/sys_user/sys_user/id -d ‘ {"loginName":"name2","password":"password2"}‘
文档删除: curl -H ‘Content-Type:application/json‘ -XDELETE http://hostip:9200/sys_user/sys_user/id
文档查看: curl -H ‘Content-Type:application/json‘ -XGET http://hostip:9200/sys_user/sys_user/id
原文:https://www.cnblogs.com/upcalm/p/12172455.html