我创建了一个具有以下设置的新索引:
"settings": {
"index": {
"number_of_shards": "5",
"blocks": {
"read_only_allow_delete": "false" // null was tested also
},
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": "1",
"max_gram": "20"
}
},
"analyzer": {
"autocomplete": {
"filter": [
"lowercase",
"autocomplete_filter"
],
"type": "custom",
"tokenizer": "standard"
}
}
},
"number_of_replicas": "2"
}
}
现在,当我首次使用邮递员为新文档建立索引时,它已正确建立了索引,但是下一个文档发出了错误,在出现错误后,我发送了GET请求,并注意到设置变为:
"settings": {
"index": {
"number_of_shards": "5",
"blocks": {
"read_only_allow_delete": "true"
},
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": "1",
"max_gram": "20"
}
},
"analyzer": {
"autocomplete": {
"filter": [
"lowercase",
"autocomplete_filter"
],
"type": "custom",
"tokenizer": "standard"
}
}
},
"number_of_replicas": "2"
}
}
因此,在为第一个文档建立索引后,如何将"read_only_allow_delete"
设置为true
。
创建索引后,我验证了设置,但它不是false
错误:
403 - {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}