Failed to parse mapping [

tech2023-01-07  156

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" } } } }

成功

最新回复(0)