Elasticsearch笔记

1:curl -X GET "127.0.0.1:9200/_cat/health?v"  健康检查

2:curl -X GET "127.0.0.1:9200/_cat/nodes?v"  集群节点查看

3:curl -X GET "127.0.0.1:9200/_cat/indices?v" 数据库查看

4:curl -X PUT "127.0.0.1:9200/log-test-0515"   新建数据库

5:curl -X PUT "127.0.0.1:9200/gyl-test/_doc/1?pretty" -H 'Content-type: application/json' -d'{"name": "abcd"}'  新增数据

6:curl -X GET "127.0.0.1:9200/gyl-test/_doc/1?pretty"   查看数据库中的数据

7:curl -X DELETE "127.0.0.1:9200/gyl-test/_doc/1?pretty" 删除数据

8: curl -X POST "127.0.0.1:9200/gyl-test/_doc/1?pretty" -H 'Content-type: application/json' -d'{"name": "abcd", "age": 40}'   更新数据

(返回值里有个状态,已有为update,没有为create)

9: curl -X GET "127.0.0.1:9200/gyl-test/_search?pretty" -H 'Content-type: application/json' -d'{ "query": { "match_all": {}}, "size": 10}'   根据条件查询


10:elasticdump --input http://172.16.100.85:9200/emotibot-sessions-2019-06-17 --output ./emotibot-records-2019-06-17.json --type=mapping:备份:yum install elasticdump -y

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容