Julius Elvis
Julius Elvis

Reputation: 31

"mapper_parsing_exception" error in postman

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

Upvotes: 0

Views: 734

Answers (1)

Nishant
Nishant

Reputation: 7864

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

Upvotes: 1

Related Questions