请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

建立索引的时候"mapper_parsing_exception"

我在建立索引的时候显示报错,es版本7.0.0

    "settings": {
        "number_of_replicas": 0
    },
    "mappings": {
        "house": {
            "dynamic": false,
            "properties":{
                "title": {
                    "type": "text",
                    "index": "analyzed"
                },
                "price": {
                    "type": "integer"
                },
                "area": {
                    "type": "integer"
                },
                "createTime": {
                    "type": "date",
                    "format": "strict_date_optional_time||epoch_millis"
                },
                "lastUpdateTime": {
                    "type": "date",
                    "format": "strict_date_optional_time||epoch_millis"
                },
                "cityEnName": {
                    "type": "keyword"
                },
                "regionEnName": {
                    "type": "keyword"
                },
                "direction": {
                    "type": "integer"
                },
                "distanceToSubway": {
                    "type": "integer"
                },
                "subwayLineName": {
                    "type": "keyword"
                },
                "subwayStationName": {
                    "type": "keyword"
                },
                "tags": {
                    "type": "text"
                },
                "street": {
                    "type": "keyword"
                },
                "district": {
                    "type": "keyword"
                },
                "description": {
                    "type": "text",
                    "index": "analyzed"
                },
                "layoutDesc": {
                    "type": "text",
                    "index": "analyzed"
                },
                "traffic": {
                    "type": "text",
                    "index": "analyzed"
                },
                "roundService": {
                    "type": "text",
                    "index": "analyzed"
                },
                "rentWay": {
                    "type": "integer"
                }
            }
        }
    }
}

这个是错误提示

{
    "error": {
        "root_cause": [
            {
                "type": "mapper_parsing_exception",
                "reason": "Root mapping definition has unsupported parameters:  [house : {dynamic=false, properties={area={type=integer}, roundService={index=analyzed, type=text}, description={index=analyzed, type=text}, title={index=analyzed, type=text}, subwayStationName={type=keyword}, layoutDesc={index=analyzed, type=text}, tags={type=text}, rentWay={type=integer}, distanceToSubway={type=integer}, createTime={format=strict_date_optional_time||epoch_millis, type=date}, price={type=integer}, street={type=keyword}, district={type=keyword}, cityEnName={type=keyword}, regionEnName={type=keyword}, lastUpdateTime={format=strict_date_optional_time||epoch_millis, type=date}, direction={type=integer}, subwayLineName={type=keyword}, traffic={index=analyzed, type=text}}}]"
            }
        ],
        "type": "mapper_parsing_exception",
        "reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [house : {dynamic=false, properties={area={type=integer}, roundService={index=analyzed, type=text}, description={index=analyzed, type=text}, title={index=analyzed, type=text}, subwayStationName={type=keyword}, layoutDesc={index=analyzed, type=text}, tags={type=text}, rentWay={type=integer}, distanceToSubway={type=integer}, createTime={format=strict_date_optional_time||epoch_millis, type=date}, price={type=integer}, street={type=keyword}, district={type=keyword}, cityEnName={type=keyword}, regionEnName={type=keyword}, lastUpdateTime={format=strict_date_optional_time||epoch_millis, type=date}, direction={type=integer}, subwayLineName={type=keyword}, traffic={index=analyzed, type=text}}}]",
        "caused_by": {
            "type": "mapper_parsing_exception",
            "reason": "Root mapping definition has unsupported parameters:  [house : {dynamic=false, properties={area={type=integer}, roundService={index=analyzed, type=text}, description={index=analyzed, type=text}, title={index=analyzed, type=text}, subwayStationName={type=keyword}, layoutDesc={index=analyzed, type=text}, tags={type=text}, rentWay={type=integer}, distanceToSubway={type=integer}, createTime={format=strict_date_optional_time||epoch_millis, type=date}, price={type=integer}, street={type=keyword}, district={type=keyword}, cityEnName={type=keyword}, regionEnName={type=keyword}, lastUpdateTime={format=strict_date_optional_time||epoch_millis, type=date}, direction={type=integer}, subwayLineName={type=keyword}, traffic={index=analyzed, type=text}}}]"
        }
    },
    "status": 400
}

正在回答 回答被采纳积分+3

插入代码

1回答

瓦力老师 2019-05-08 16:29:36

亲,每个es大版本对索引的建立都有变更,而且不兼容,所以建议先使用课程内版本去学习基础应用,然后再学习es的高级技术升级

1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信