How to change the _routing field

i create the index:
PUT mobile_info/?pretty
{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 1
},
"mappings": {
"info": {
"_routing":{
"required":"true"
},
"properties": {
"cust_no": {
"type": "keyword"
}
}
}
}
}

but i want to change the _routing.required field to false,how to change it?

i try to request :
POST mobile_info/info/_mapping
{"_routing":{"required":false}}

there is no error ,response with {"acknowledged":true} ,howerver it dosen't work!!

Please format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

What version are you on? I just tried your first PUT and got;

{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "Root mapping definition has unsupported parameters:  [info : {_routing={required=true}, properties={cust_no={type=keyword}}}]"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters:  [info : {_routing={required=true}, properties={cust_no={type=keyword}}}]",
    "caused_by" : {
      "type" : "mapper_parsing_exception",
      "reason" : "Root mapping definition has unsupported parameters:  [info : {_routing={required=true}, properties={cust_no={type=keyword}}}]"
    }
  },
  "status" : 400
}

thanks, my ES version is 6.6.0。
So is there no way to change mappings._routing.required this field?

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