查看集群状态
接口url:http://xxxx:9200/_cat
查看所有索引
http://xxxx:9200/_cat/indices?v
创建索引
http://xxxx:9200/test-20230526?pretty
返回值
{
"acknowledged": true,
"shards_acknowledged": true,
"index": "test-20230526"
}
查询数据
http://xxxx:9200/seatunnel-20230526/_search?q=*&pretty
批量新增
http://xxxx:9200/_bulk
类型:POST
Header:Content-Type = application/json
请求参数:
{ "index" :{"_index":"seatunnel-20230526","_type": "testindex"}}
{"A":"","B":"INFO","task_id":"21","server_id":"1008","log_time":"2022-11-02T16:31:29","ds":"20211229","QWQE":null,"affect_data":"q"}
{ "index" :{"_index":"seatunnel-20230526","_type": "testindex"}}
{"A":"","B":"INFO","task_id":"1:21","server_id":"1008","log_time":"2021-12-29T16:34:52","ds":"20211229","QWQE":null,"affect_data":null}
由于测试用的是elasticsearch6所以必须指定_type文章来源:https://www.toymoban.com/news/detail-470446.html
注意:文章来源地址https://www.toymoban.com/news/detail-470446.html
- 5.x及以前版本一个index有一个或者多个type
- 6.X版本一个index只有一个index
- 7.X版本移除了type,type相关的所有内容全部变成Deprecated,为了兼容升级和过渡,所有的7.X版本es数据写入后type字段都默认被置为_doc
- 8.X版本完全废弃type
到了这里,关于Elasticsearch常用接口使用说明以及postman调用调试的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!