使用postman查询Linux中ES的数据

本文介绍了如何使用Elasticsearch进行基础操作,包括查询索引总数、查看详细信息、搜索数据、指定_id检索和删除数据,主要通过GET和DELETE请求针对特定服务器地址进行操作。

xxx.xxx.xxx.xxx:安装ES对应服务器的地址。

1、查询es中有总共有多少个索引。(get请求)

http://xxx.xxx.xxx.xxx:9200/_cat/indices?v

2、查询当前索引(index_name)的详细信息。(get请求)

http://192.168.3.11:9200/km_docxxx.xxx.xxx.xxx:9200/index_name

3、查询当前索引(index_name)下的所有存储数据。(get请求)
http://xxx.xxx.xxx.xxx:9200/index_name/_search

4、查询当前索引(index_name)下_id为ABC的数据。(get请求)
http://xxx.xxx.xxx.xxx:9200/index_name/_doc/ABC

5、删除当前索引(index_name)下_id为ABC的数据。(delete请求)
http://xxx.xxx.xxx.xxx:9200/index_name/_doc/ABC

6、新增当前索引(index_name)下的mapping属性值。(put请求)

http://xxx.xxx.xxx.xxx:9200/index_name/_mapping

body中传入的json串:

{

    "properties": {

        "新增属性1": {

            "type": "text"

        },

        "新增属性2": {

            "type": "text"

        }

    }

}

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值