首页 > 其他 > 详细

es学习-索引管理

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

 

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学习-索引管理

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!