# How to change the \_routing field

**URL:** <https://discuss.elastic.co/t/how-to-change-the-routing-field/272488>\
**Category:** Elasticsearch\
**Created:** [May 9, 2021, 7:56am UTC](https://discuss.elastic.co/t/how-to-change-the-routing-field/272488 "2021-05-09T07:56:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anyzm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anyzm/32/84164_2.png) [@Anyzm](https://discuss.elastic.co/u/Anyzm)\
**Post date:** [May 9, 2021, 7:56am UTC](https://discuss.elastic.co/t/how-to-change-the-routing-field/272488/1 "2021-05-09T07:56:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Anyzm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anyzm/32/84164_2.png) [@Anyzm](https://discuss.elastic.co/u/Anyzm)\
**Post date:** [May 9, 2021, 8:07am UTC](https://discuss.elastic.co/t/how-to-change-the-routing-field/272488/2 "2021-05-09T08:07:28Z")

</div>

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！！

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 10, 2021, 12:22am UTC](https://discuss.elastic.co/t/how-to-change-the-routing-field/272488/3 "2021-05-10T00:22:59Z")

</div>

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 🙂

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

```auto
{
  "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
}

```

---

<div class="post-metadata">

**Author:** ![Anyzm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anyzm/32/84164_2.png) [@Anyzm](https://discuss.elastic.co/u/Anyzm)\
**Post date:** [May 10, 2021, 2:28am UTC](https://discuss.elastic.co/t/how-to-change-the-routing-field/272488/4 "2021-05-10T02:28:09Z")

</div>

thanks， my ES version is 6.6.0。  
So is there no way to change mappings.\_routing.required this field？

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 7, 2021, 2:28am UTC](https://discuss.elastic.co/t/how-to-change-the-routing-field/272488/5 "2021-06-07T02:28:33Z")

</div>

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