错误:[mapper_parsing_exception]根映射定义具有不受支持的参数

时间:2019-08-13 13:25:04

标签: indexing parseexception

我对这段代码有问题,每次尝试索引时,evrytime都会显示错误:

“错误:[mapper_parsing_exception]根映射定义具有不受支持的参数:[文档:{dynamic = false,properties = {alertStatus = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}}} ,orderNumber = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}},crmNumber = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}},triggerValue = {type = float},SLPOSX = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}},blockAlert = {type = date},startAlert = {type = date},neocaseId = { type = integer},path = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}},startInterval = {type = date},alertClass = {type = text,fields = {keyword = { ignore_above = 256,type = keyword}}},@ version = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}},host = {type = text,fields = {keyword = {ignore_above = 256,类型=关键字}}},subscriberId = {类型=文本,字段= {关键字= {ignore_above = 256,类型=关键字}}},公司= {类型=文本,字段= {关键字= {ignore_above = 256 ,类型=关键字}}},条形码= {t ype = text,字段= {关键字= {ignore_above = 256,类型=关键字}}},endInterval = {type = date},alertCode = {type = text,字段= {关键字= {ignore_above = 256,类型=关键字} }},SLPONR = {type = text,字段= {keyword = {ignore_above = 256,type = keyword}}},customerNumber = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}} ,消息= {类型=文本,字段= {关键字= {ignore_above = 256,类型=关键字}}},endAlert = {type = date},标签= {类型=文本,字段= {关键字= {ignore_above = 256, type = keyword}}},@ timestamp = {type = date},region = {type = text,fields = {keyword = {ignore_above = 256,type = keyword}}},设施= {type = text,fields = { keyword = {ignore_above = 256,type = keyword}}}}}]“

有人知道吗? 谢谢

msg.payload = {

"mappings": {

    "document": {
        "dynamic": false,
        "properties": {
            "alertStatus": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "orderNumber": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "alertClass": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
             "alertCode": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },

            "subsidiaryId": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "crmNumber": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "triggerValue": {
                "type": "float"
            },
            "neocaseId": {
                "type": "integer",
            },
            "SLPONR": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "SLPOSX": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "blockAlert": {
                "type": "date"
            },
            "startAlert": {
                "type": "date"
            },

            "customerNumber": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },

            "message": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "endAlert": {
                "type": "date"
            },
            "tags": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "path": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },

            "@timestamp": {
                "type": "date"
            },
            "startInterval": {
                "type": "date"
            },
            "@version": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "host": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "company": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "region": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "barcode": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "facility": {
                "type": "text",
                "fields": {
                    "keyword": {
                        "ignore_above": 256,
                        "type": "keyword"
                    }
                }
            },
            "endInterval": {
                "type": "date"
            }
        }
    }
}

}; 返回味精;

1 个答案:

答案 0 :(得分:0)

尝试添加

"type_name": {                <--- add the type name   
    "properties": {             <--- enclose all field definitions in "properties"