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

61.index CUD

时间:2018-02-26 21:41:49      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:family   ber   mono   des   company   span   mapping   action   ast   

主要知识点

  • 索引CUD

   

一、创建索引的语法

   

PUT /my_index

{

"settings": { ... any settings ... },

"mappings": {

"type_one": { ... any mappings ... },

"type_two": { ... any mappings ... },

...

}

}

   

创建索引的示例

   

PUT /company

{

"settings":{

"number_of_shards":1,

"number_of_replicas":0

},

"mappings": {

"employee": {

"properties": {

"name":{

"type":"text"

}

}

}

}

}

   

二、修改索引

   

PUT /company/_settings

{

"number_of_replicas": 1

}

   

三、删除索引

DELETE /my_index

DELETE /index_one,index_two

DELETE /index_*

DELETE /_all

   

四、其他

elasticsearch.yml中把action.destructive_requires_name: true,这样设置后就不能直接用delete /_all把所有的索引删除,必须指定索引名才能删除

61.index CUD

标签:family   ber   mono   des   company   span   mapping   action   ast   

原文地址:https://www.cnblogs.com/liuqianli/p/8475471.html

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