can‘t be changed from nested to non-nested

{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "object mapping [ty_scenic_list] can't be changed from nested to non-nested"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "object mapping [ty_scenic_list] can't be changed from nested to non-nested"
    },
    "status": 400
}

我的 mapping type 定义

{
    "mappings":{
         #这里定义了type
        "ty_zyb_product":{
            "properties":{
                "ty_corp_code":{
                    "type":"keyword"
                },
                "ty_parent_corp_code":{
                    "type":"keyword"
                },
                "ty_scenic_id":{
                    "type":"long"
                },
                "ty_product_id":{
                    "type":"keyword"
                },
                "ty_status":{
                    "type":"keyword"
                },
                "association":{
                    "type":"boolean"
                },
                "zyb_corp_code":{
                    "type":"keyword"
                },
                "zyb_scenic_id":{
                    "type":"keyword"
                },
                "zyb_scenic_name":{
                    "type":"text"
                },
                "zyb_product_code":{
                    "type":"keyword"
                },
                "zyb_product_name":{
                    "type":"text"
                },
                "createTime":{
                    "type":"date",
                    "format": "yyyy-MM-dd HH:mm:ss,SSS||yyyy-MM-dd HH:mm:ss||epoch_millis"
                },
                "modifyTime":{
                    "type":"date",
                    "format": "yyyy-MM-dd HH:mm:ss,SSS||yyyy-MM-dd HH:mm:ss||epoch_millis"
                },
                "ty_scenic_list": {
                    "type": "nested",
                    "properties": {
                        "ty_scenic_id_n": {
                            "type": "long"
                        },
                        "ty_status_n": {
                            "type": "long"
                        }
                    }
                }          
            }
        }
    }
}

报这个错误的原因其实很简单,请求地址没有写对

正确的写法

                        |   索引          |       type      |
http://192.168.*.*:9200/ty_zyb_product/ty_zyb_product
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值