elasticsearch Opensearch索引集忽略格式错误不起作用

h9vpoimq  于 5个月前  发布在  ElasticSearch
关注(0)|答案(1)|浏览(50)

Opensearch不想更新ignore_malformed属性。
所以我有这个非常简单的代码来创建一个新的索引:

PUT testindex001
{
    "mappings": {
        "properties": {
            "kubernetes": {
                "type": "object",
                "properties": {
                    "annotation": {
                        "type": "object",
                        "properties": {
                            "kubectl_kubernetes_io/restartedAt": {
                                "type": "date",
                                "ignore_malformed": false
                            }
                        }
                    }
                }
            }
        }
    }
}

字符串
如果我尝试用下面的命令将ignore_malformed属性更新为true,

PUT testindex001
{
    "mappings": {
        "properties": {
            "kubernetes": {
                "properties": {
                    "annotation": {
                        "properties": {
                            "kubectl_kubernetes_io/restartedAt": {
                                "type": "date",
                                "ignore_malformed": true
                            }
                        }
                    }
                }
            }
        }
    }
}


它给了我一个错误
“类型”:“resource_already_exists_exception”,“reason”:“index [testindex001/_VoE6UwcTg6V-3QQ4KigDg] already exists”,“index”:“testindex001”,“index_uuid”:“_VoE6UwcTg6V-3QQ4KigDg”“status”:400
我错过了什么?

mznpcxlj

mznpcxlj1#

也许我问得太快了,因为我已经解决了。

PUT testindex001/_mapping
{
    "properties": {
        "kubernetes": {
            "properties": {
                "annotation": {
                    "properties": {
                        "kubectl_kubernetes_io/restartedAt": {
                            "type": "date",
                            "ignore_malformed": true
                        }
                    }
                }
            }
        }
    }
}

字符串

相关问题