
index读写状态设置
PUT /news/_settings
{
"index.blocks.read_only":false,
"index.blocks.write":true
}
POST /news/_close
POST /news/_open
别名设置
POST /_aliases
{
"actions": [
{
"add": {
"index": "new_1",
"alias": "niuniu",
"is_write_index": true
}
},{
"add": {
"index": "news",
"alias": "niuniu",
"is_write_index": false
}
}
]
}
删除别名
POST /_aliases
{
"actions": [
{
"remove": {
"index": "new_1",
"alias": "niuniu"
}
},{
"remove": {
"index": "news",
"alias": "niuniu"
}
}
]
}
PUT /new_1
{
"settings": {
"number_of_shards": "5",
"max_result_window": "100000000",
"number_of_replicas": "1"
},
"mappings": {}
}
本文介绍了如何在 Elasticsearch 中设置索引的读写状态,包括将索引设置为只读、只写以及关闭和打开索引。同时,详细讲解了创建和删除别名的操作,包括设置别名的写入索引标志。
784

被折叠的 条评论
为什么被折叠?



