Elasticsearch基础命令
#查询集群信息
GET _cat/health?v
#查询所有索引
GET _cat/indices?v
#查询指定索引信息
GET /{index_name}?pretty
#查询索引内容
get /{index_name}/_search?pretty
#查询所有索引的副本信息
GET _cat/shards?v
#查询指定索引的副本信息
GET _cat/shards/{shards_name}
#指定索引修改副本数量
PUT index_name/_settings
{
"number_of_replicas": 1
}
当number_of_replicas的值为0的时候,相当于删除了索引的副本数。
#查询索引模板信息
GET _cat/templates?v
#创建索引模板
PUT _template/{template name}
{
"xx":"xx"
}
#查询索引模板内容
GET _template/{template name}
#查询所有节点信息
GET _cat/nodes?v
#查询所有角色
GET /_security/role?pretty
#创建所有角色
PUT /_security/role/{role_name}
{
"xx":"xx"
}
#查询指定角色
GET /_security/role/{role_name}
#查询所有用户
GET /_security/user?pretty
#创建用户
PUT /_security/user?pretty
{
"xx":"xx"
}
#查询指定用户
GET /_security/user/{user_name}
#在指定索引中插入数据
PUT /{index_name}/{type_name}/{id}
{
"xx":"xx"
}
#查看索引中的数据内容
GET /{index_name}/{type_name}/{id}