首页 技术 正文
技术 2022年11月14日
0 收藏 362 点赞 2,318 浏览 1853 个字

本文为官方文档的译文加个人理解。作者翻译时,elasticsearch(下面简称es)的版本为1.2.2。请支持原创:http://www.cnblogs.com/donlianli/p/3836768.html 一、统计信息相关命令的变化有关集群状态cluster_state, 节点信息nodes_info, 节点统计信息nodes_stats和索引信息indices_stats命令格式进行了统一,比如查看集群信息使用命令:

curl -XGET http://localhost:9200/_cluster/state/nodes?pretty=1

查看节点统计信息:

curl -XGET http://localhost:9200/_nodes/stats?pretty=1集群统计信息curl -XGET http://localhost:9200/_cluster/stats?pretty=1

 


二、索引相关api

mapping, alias, settings和warmer相关命令和参数的顺序有所调整。新的顺序及格式如下:

 

curl -XPUT http://localhost:9200/{indices}/_mapping/{type}
curl -XPUT http://localhost:9200/{indices}/_alias/{name}
curl -XPUT http://localhost:9200/{indices}/_warmer/{name}curl -XGET http://localhost:9200/{indices}/_mapping/{types}
curl -XGET http://localhost:9200/{indices}/_alias/{names}
curl -XGET http://localhost:9200/{indices}/_settings/{names}
curl -XGET http://localhost:9200/{indices}/_warmer/{names}curl -XDELETE http://localhost:9200/{indices}/_mapping/{types}
curl -XDELETE http://localhost:9200/{indices}/_alias/{names}
curl -XDELETE http://localhost:9200/{indices}/_warmer/{names}

其中{indices},{type}和{name}可以是下面的任意一种:

  • _all, * 或者为空,这3种取值意思都一样,代表所有可能的值
  • 通配符,比如“test*”
  • 逗号分隔的列表,比如: index_1,test_*

 

唯一的例外就是DELETE命令,这个命令不接收空的值。如果你想删除什么,必须明确指定。

 同样,Get命令返回的结果也进行了统一。

  1. 只有查询有结果时,才返回具体的值,否则的话,只返回一个空对象{}。当查询的mapping,warmer,alias,setting不存在时,不再返回404。
  2. 如果查询到了结果,则结果中总是包含索引名称,然后是section,然后是元素名称。例如:

{
    “my_index”: {
        “mappings”: {
            “my_type”: {…}
        }
    }
}

上面是 get_mapping API返回的结果。

In the future we will also provide plural versions to allow putting multiple mappings etc in a single request.

这句话的意思,好像是在说,可以在一个请求中设置两个版本的mappings。

原文地址:http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/_stats_and_info_apis.htmlhttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/_indices_apis.html未完待续…… 关于我,邯郸人。对这类话题感兴趣?欢迎发送邮件至donlianli@126.com更多elasticsearch介绍,请参考:http://www.iteye.com/blogs/subjects/elasticsearch-tutor

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,942
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,466
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,281
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,095
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,728
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,765