Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:

Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters

看请求路径如下:
在这里插入图片描述
返回的错误信息

{
    
    
    "error": {
    
    
        "root_cause": [
            {
    
    
                "type": "mapper_parsing_exception",
                "reason": "Root mapping definition has unsupported parameters:  [article : {properties={id={index=not_analyzed, store=true, type=long}, title={analyzer=standard, index=analyzed, store=true, type=text}, content={analyzer=standard, index=analyzed, store=true, type=text}}}]"
            }
        ],
        "type": "mapper_parsing_exception",
        "reason": "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [article : {properties={id={index=not_analyzed, store=true, type=long}, title={analyzer=standard, index=analyzed, store=true, type=text}, content={analyzer=standard, index=analyzed, store=true, type=text}}}]",
        "caused_by": {
    
    
            "type": "mapper_parsing_exception",
            "reason": "Root mapping definition has unsupported parameters:  [article : {properties={id={index=not_analyzed, store=true, type=long}, title={analyzer=standard, index=analyzed, store=true, type=text}, content={analyzer=standard, index=analyzed, store=true, type=text}}}]"
        }
    },
    "status": 400
}

body里的东西

{
    
    
    "mappings": {
    
    
        "article": {
    
    
            "properties": {
    
    
                "id": {
    
    
                	"type": "long",
                    "store": true,
                    "index":"not_analyzed"
                },
                "title": {
    
    
                	"type": "text",
                    "store": true,
                    "index":"analyzed",
                    "analyzer":"standard"
                },
                "content": {
    
    
                	"type": "text",
                    "store": true,
                    "index":"analyzed",
                    "analyzer":"standard"
                }
            }
        }
    }
}

ES官方文档https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
查了查资料
在这里插入图片描述
修改请求体

{
    
    
    "mappings": {
    
    
            "properties": {
    
    
                "id": {
    
    
                	"type": "long",
                    "store": true
                },
                "title": {
    
    
                	"type": "text",
                    "store": true,
                    "analyzer":"standard"
                },
                "content": {
    
    
                	"type": "text",
                    "store": true,
                    "analyzer":"standard"
                }
            }
    }
}

成功
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_39095899/article/details/108379900