“ mapper_parsing_exception”邮递员中的错误 [英] "mapper_parsing_exception" error in postman

查看:176
本文介绍了“ mapper_parsing_exception”邮递员中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用邮递员与弹性搜索服务器进行通信,当我尝试与我的弹性搜索服务器连接时,我在邮递员中收到错误消息。我哪里出问题了?
这是我的代码。

i'm using postman to communicate with elastic search server and i am receiving an error in postman when i am trying to connect with my elastic search server. Where could i have gone wrong? Here is my code.

{
  "mappings": {
    "post": {
      "properties": {
        "city": {
          "type": "text"
        },
        "contact_email": {
          "type": "text"
        },
        "country": {
          "type": "text"
        },
        "description": {
          "type": "text"
        },
        "image": {
          "type": "text"
        },
        "post_id": {
          "type": "text"
        },
        "state_province": {
          "type": "text"
        },
        "title": {
          "type": "text"
        }
      }
    }
  }
}

我尝试与服务器通信,但我一直收到此错误

i've tried communicating with my server but i keep receiving this error

        "root_cause": [
            {
                "type": "mapper_parsing_exception",
                "reason": "Root mapping definition has unsupported parameters:  [post : {properties={country={type=text}, image={type=text}, post_id={type=text}, city={type=text}, description={type=text}, state_province={type=text}, title={type=text}, contact_email={type=text}}}]"
            }


推荐答案

似乎您使用的是Elasticsearch 7.0版。由于Elasticsearch每个索引不再支持一种以上的映射类型,因此不再需要映射名称,并且在此版本中不应该提供。
从json输入中删除映射名称 post 。用法如下:

Seems like you are using elasticsearch version 7.0. Since elasticsearch no more support more than one mapping type per index, mapping name is no more required and should not be provided in this version. Remove the mapping name post from the json input. Use as below:

{
  "mappings": {
    "properties": {
      "city": {
        "type": "text"
      },
      "contact_email": {
        "type": "text"
      },
      "country": {
        "type": "text"
      },
      "description": {
        "type": "text"
      },
      "image": {
        "type": "text"
      },
      "post_id": {
        "type": "text"
      },
      "state_province": {
        "type": "text"
      },
      "title": {
        "type": "text"
      }
    }
  }
}

这篇关于“ mapper_parsing_exception”邮递员中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆