Elasticsearch学习(一)————简单命令
Elasticsearch
一.简介
**Elasticsearch 是一个分布式的搜索和分析引擎,可以用于全文检索、结构化检索和分析,并能将这三者结合起来。Elasticsearch 基于 Lucene 开发,现在是使用最广的开源搜索引擎之一,Wikipedia、Stack Overflow、GitHub 等都基于 Elasticsearch 来构建他们的搜索引擎。**
1
二.简单命令
注意:kibana中如下,如果是postman:GET HTTP://IP:PORT/_cat/health?v
1. GET _cat/health?v   查看集群的健康状况
	示例:
epoch timestamp cluster  status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1558361442 14:10:42  elasticsearch yellow          1         1      8   8    0    0       11             0                  -                 42.1%
1
2
3
4
2. GET _cat/indices?v       //查看集群中有哪些索引
	示例:
health status index uuid                   pri rep docs.count docs.deleted store.size pri.store.size
yellow open   obj   z01R9FXXTv6Rizq0EqtFew   3   2          0            0       573b           573b
yellow open   test  ioDbb57KSbaC6iwaRiKT7A   5   1          1            0      6.3kb          6.3kb
1
2
3
4
5
3. PUT /index_name?pretty       //创建索引
1
5. DELETE /index_name?pretty    //删除索引
1
6. POST /index/type/id 或者 PUT /index/type/id             //也可以不指定id, es会生成base64的20长度的字符串ID,集群下不可能重复
	{json}
1
2
7. POST /index/type/id 或者 PUT /index/type/id  修改内容
	{json}   //注意;POST 修改某个;PUT 必须 带上所有字段
	//kibana:  POST /index/type/id/_update  PUT /index/type/id/_update
--------------------- 
 
                     
                    
                 
                    
                 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号