如何使用“空字符串”但没有字段名称的原因调试弹性搜索错误number_format_exception

时间:2019-02-26 20:34:14

标签: elasticsearch

我刚刚部署了一个小型应用程序,该应用程序将数千个文档加载到索引中,并且在使用生产数据时,我的搜索请求中出现错误。

http代码是400,错误是

{
    "error": {
        "root_cause": [
            {
                "type": "number_format_exception",
                "reason": "empty String"
            }
        ],
        "type": "number_format_exception",
        "reason": "empty String"
    },
    "status": 400
}

好吧,我有点理解我的映射定义了一些我以前无法正确存储的数字字段,但是我应该如何找到该字段?

每个文档都包含许多字段。...我的意思是真的吗?

我尝试在/ var / log / elasticsearch中查找,但那里没有任何用处...

请帮助我,我需要把事情进展下去

我将字段定义为整数,该整数应包含数组,并且可能为空。可能有问题吗?

我的ES版本是6.6.0

更新

搜索过程中确实发生了错误,在索引全部正常期间

我对该索引的映射:

{
    "development-object-1551202425": {
        "mappings": {
            "_doc": {
                "dynamic": "false",
                "properties": {
                    "accommodation": {
                        "properties": {
                            "badges": {
                                "properties": {
                                    "maskedProp1": {
                                        "type": "boolean"
                                    },
                                    "maskedProp2": {
                                        "type": "boolean"
                                    },
                                    "maskedProp3": {
                                        "type": "boolean"
                                    },
                                    "maskedProp4": {
                                        "type": "boolean"
                                    },
                                    "maskedProp5": {
                                        "type": "boolean"
                                    },
                                    "maskedProp6": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "businessTypes": {
                                "type": "integer"
                            },
                            "classification": {
                                "properties": {
                                    "classification": {
                                        "type": "keyword"
                                    },
                                    "classificationValue": {
                                        "type": "short"
                                    }
                                }
                            },
                            "endowments": {
                                "type": "integer"
                            },
                            "hasPrice": {
                                "type": "boolean"
                            },
                            "lowestPrice": {
                                "type": "float"
                            },
                            "metascore": {
                                "type": "short"
                            },
                            "rating": {
                                "type": "short"
                            },
                            "regionscore": {
                                "type": "short"
                            }
                        }
                    },
                    "certificates": {
                        "type": "integer"
                    },
                    "geoLocation": {
                        "type": "geo_point"
                    },
                    "id": {
                        "type": "text"
                    },
                    "isAccommodation": {
                        "type": "boolean"
                    },
                    "location": {
                        "properties": {
                            "maskedProp1": {
                                "type": "integer"
                            },
                            "maskedProp2": {
                                "type": "integer"
                            },
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "text",
                                "fielddata": true
                            },
                            "zipcodes": {
                                "type": "integer"
                            }
                        }
                    },
                    "maskedProp1": {
                        "type": "integer"
                    },
                    "maskedProp2": {
                        "type": "integer"
                    },
                    "description": {
                        "type": "text"
                    },
                    "sortTitle": {
                        "type": "keyword"
                    },
                    "title": {
                        "type": "text"
                    }
                }
            }
        }
    }
}

该名称由一个环境字符串(开发)和一个附加的时间戳组成(我使用自动索引切换并查询别名,该名称确实称为{env}-{name} -current。

1 个答案:

答案 0 :(得分:0)

在我的情况下,该错误是查询中的空“大小”参数,我试图在过滤器中找到该错误,但没有看到...

我认为xD更详尽的错误消息(至少在什么属性或设置错误发生时)可以节省数千小时的调试时间。

现在,您必须逐节分解dsl来查找问题。