码迷,mamicode.com
首页 > 其他好文 > 详细

es学习-索引管理

时间:2018-07-28 21:49:42      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:.com   inf   分片   ring   number   技术   alt   rop   map   

 

1.创建索引

http://192.168.0.108:9200/suoyinguanli211/

 

参数:

{
   "settings":{
      "index":{
          "number_of_shards":3,分片数
          "number_of_replicas":2 副本数
     }
  }
}

 

 

技术分享图片

结果如图

技术分享图片

 

修改索引信息

 url:http://192.168.0.108:9200/suoyinguanli211/_settings/

 

参数:

{
"number_of_replicas":1
}

技术分享图片

结果:

技术分享图片

定义映射类型:

url:http://192.168.0.108:9200/suoyinguanli211-1/

参数:

{
	"settings": {
		"index": {
			"number_of_shards": 3,
			"number_of_replicas": 1
		},
		"mapping": {
			"secilog": {
				"properties": {
					"name": {
						"type": "string",
						"index": "not_analyzed"
					},
					"name2": {
						"type": "string",
						"index": "analyzed"
					}
				}
			}
		}
	}
}

  

结果:

技术分享图片

 

删除索引:

url :delete http://192.168.0.108:9200/suoyinguanli211-1/

技术分享图片

 

获取索引:

技术分享图片

 

es学习-索引管理

标签:.com   inf   分片   ring   number   技术   alt   rop   map   

原文地址:https://www.cnblogs.com/anxbb/p/9383354.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!