ElasticSearch6.x 之索引

1、创建索引

    创建索引语法规则:http://elasticsearch 服务器访问地址/索引名称,Put请求, 无参数

    实列:http://192.168.1.74:9200/security/,在elasticsearch 服务器上创建名为security 的索引。

    截图:

注意:(1)、索引不能包含大写字母。

           (2)、索引不能重复创建。

 

2、创建索引并且指定索引配置参数:

创建索引语法规则:http://elasticsearch 服务器访问地址/索引名称,Put请求,携带index 初始化配置参数

实列:http://192.168.1.74:9200/shopping/,在elasticsearch 服务器上创建名为shopping 的索引,携带shopping 初始化配置参数:{"settings": { "number_of_shards": 3, "number_of_replicas": 1 }

截图:

 

3、查看索引

查看索引语法规则:http://elasticsearch 服务器访问地址/索引名称/_settings, Get请求,无参数。

实列:http://192.168.1.74:9200/shopping/_settings/,查看elasticsearch 服务器上关于shopping 索引的相关信息。

截图:

4、查看多个索引

查看多个索引语法规则:http://elasticsearch 服务器访问地址/索引名称1,索引名称2.../_settings, Get请求,无参数。

实列:http://192.168.1.74:9200/shopping,security/_settings/,查看elasticsearch 服务器上关于shopping索引、security索引的相关信息。

截图:

5、删除索引

删除索引语法规则:http://elasticsearch 服务器访问地址/索引名称, Delete 请求, 无参数

实列:http://192.168.1.74:9200/blog/, elasticsearch 服务器关闭blog 索引。

截图:

6、禁止/启用 索引

禁用索引语法规则:http://elasticsearch 服务器访问地址/索引名称/_close, Post 请求, 无参数

实列:http://192.168.1.74:9200/shopping/_close/,elasticsearch 服务器关闭shopping 索引。

截图:

启用索引语法规则:http://elasticsearch 服务器访问地址/索引名称/_open, Post 请求, 无参数

实列:http://192.168.1.74:9200/shopping/_open/,elasticsearch 服务器重新开启shopping 索引。

截图:

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值