Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
599 views
in Technique[技术] by (71.8m points)

Getting error action_request_validation_exception while mapping new field in already exist Elasticsearch index

I am trying to add a new field to my already exist Elasticsearch index but I'm getting the below exception:

{
  "type": "action_request_validation_exception",
  "reason": "Validation Failed: 1: mapping type is missing;"
}

I'm using the below API

PUT order/_mapping
{
  "properties": {
    "title":  { "type": "text"}
  }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to add the mapping type to the PUT request, and modify the request as :

PUT order/{{mapping-type}}/_mapping
{
  "properties": {
    "title":  { "type": "text"}
  }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...