建立索引的时候"mapper_parsing_exception"

来源:8-3 索引结构设计(上)

歌路遥遥

2019-05-02

我在建立索引的时候显示报错,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
}
写回答

1回答

瓦力老师

2019-05-08

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

1
0

BAT大牛亲授 基于ElasticSearch的搜房网实战

ES+MySQL+Kafka,打造强力站内搜索

898 学习 · 285 问题

查看课程