elasticsearch 笔记十八:索引管理

xiaoxiao2025-09-02  13

1、创建索引 创建索引的语法 PUT /my_index { "settings": { ... any settings ... }, "mappings": { "type_one": { ... any mappings ... }, "type_two": { ... any mappings ... }, ... } } 创建索引的示例 PUT /my_index { "settings": { "number_of_shards": 1, "number_of_replicas": 0 }, "mappings": { "my_type": { "properties": { "my_field": { "type": "text" } } } } } 2、修改索引 PUT /my_index/_settings { "number_of_replicas": 1 } 3、删除索引 DELETE /my_index DELETE /index_one,index_two DELETE /index_* DELETE /_all

 

转载请注明原文地址: https://www.6miu.com/read-5035645.html

最新回复(0)