Validation failed: 1 :Mapping type is missing

Hi I am a newbie to Elastic search

I have created an index which source field is bit lengthy and i am suspecting that the ignore_above is restricting to visualize my data in Kibana.

So i went on trying to change the Ignore_above value but getting this error.

Here is the error and also my index mapping values,please help me out.

Request

PUT /filebeat6_example/_mapping/
{
    "message": {
      "type": {
        "type": "text",
        "ignore_above": 32766
      }
    }
}

Response--

{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: mapping type is missing;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: mapping type is missing;"
  },
  "status": 400
}

My Index default mapping values

GET /filebeat6_example/_mapping

Response

{
  "filebeat6_example": {
    "mappings": {
      "doc": {
        "properties": {
          "@timestamp": {
            "type": "date"
          },
          "@version": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "beat": {
            "properties": {
              "hostname": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "name": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "version": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "host": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "message": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "offset": {
            "type": "long"
          },
          "prospector": {
            "properties": {
              "type": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "source": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "tags": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          }
        }
      }
    }
  }
}

Welcome!

What is your elasticsearch version?

Hi,
It's 6.1.3

Any reason you can not use 7.6?

Anyway here is the documentation for PUT Mapping API for your version: https://www.elastic.co/guide/en/elasticsearch/reference/6.8/indices-put-mapping.html

Well i can't as in my organisation they told me to use to this version only

So any help for this version will really be helpful for me.

As per the link you have shared my index mapping value type is doc

So i modified the request body to this

PUT /filebeat6_example/_mapping/doc
{
    "message": {
      "type": {
        "type": "text",
        "ignore_above": 32766
      }
    }
}

got this error

"error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Root mapping definition has unsupported parameters:  [message : {type={type=text, ignore_above=32766}}]"Preformatted text

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

About your error, please look again at the documentation. You're missing the type name in the json body.

My Apologies i have formatted the request and response body in my previous msg

1 Like

Thanks!

Did you solve the problem?

nope the issue hasn't been resolved

Did you apply my advice?

About your error, please look again at the documentation. You're missing the type name in the json body.

{
"message": {
"type": {
"type": "text",
"ignore_above": 32766Preformatted text

Here i have mentioned the type name in the json body as per the documentation provided by you

Your mapping type is doc.
It should appear in the json as the documentation shows it.

Please share the full request you are sending to elasticsearch if you still can't make it work. And check the preview window for code formatting issues.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.