# About display field routing

**URL:** <https://discuss.elastic.co/t/about-display-field-routing/9296>\
**Category:** Elasticsearch\
**Created:** [October 9, 2012, 10:39pm UTC](https://discuss.elastic.co/t/about-display-field-routing/9296 "2012-10-09T22:39:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuhan](https://avatars.discourse-cdn.com/v4/letter/y/919ad9/32.png) [@Yuhan](https://discuss.elastic.co/u/Yuhan)\
**Post date:** [October 9, 2012, 10:39pm UTC](https://discuss.elastic.co/t/about-display-field-routing/9296/1 "2012-10-09T22:39:03Z")

</div>

Hi all,

I'm trying to create an index with field routing.  
[http://www.elasticsearch.org/guide/reference/mapping/routing-field.html](http://www.elasticsearch.org/guide/reference/mapping/routing-field.html)

I already had the index has existed for a while without routing,  
can I add field routing without rebuild the index? (example please..)

Another problem where should I put "\_routing" settings?

My index is named "sources", and the indexType is named "video".  
should I put it inside "mappings", inside "video", or inside "sources"?  
(I assume it should go inside "video", as it is a field with "store/index"  
options as mentioned in the documentation.  
however, the example makes me feel it should go under the indexName  
"sources":

"comment" : {  
"\_routing" : {  
"required" : true,  
"path" : "blog.post\_id"

)

(The example also confused me as having no ' index' : 'not\_analyzed',  
'store': 'yes' inside \_routing, I assume they are the default value)

Here's how I did it:

curl -XPOST localhost:9200/sources -d '{

```
"mappings" : {
    "video" : {
        "_routing" : {
        "required" : true,
        "path" : "video.id"
     },
        "properties" : {

    "id" : {
      "type" : "integer",
      "ignore_malformed" : false
    },
   ...

```

Is this right?

in order to verify the index routing, how do I display the field \_routing  
on an index?

Thank you.

Yuhan

--

---

<div class="post-metadata">

**Author:** ![Yuhan](https://avatars.discourse-cdn.com/v4/letter/y/919ad9/32.png) [@Yuhan](https://discuss.elastic.co/u/Yuhan)\
**Post date:** [October 10, 2012, 12:49am UTC](https://discuss.elastic.co/t/about-display-field-routing/9296/2 "2012-10-10T00:49:57Z")

</div>

to answer my own question, I changed "path" : "id" and listed "\_routing"  
aside of "properties",  
and it worked. verified the shard number to be consistent through the java  
client.

curl -XPOST localhost:9200/sources -d '{

```
"mappings" : {
    "video" : {
        "_routing" : {
        "required" : true,
        "path" : "id <http://video.id>"
     },
        "properties" : {

    "id" : {
      "type" : "integer",
      "ignore_malformed" : false
    },
   ...

```

Thank you.

Yuhan

On Tue, Oct 9, 2012 at 3:39 PM, Yuhan Zhang [yzhang@onescreen.com](mailto:yzhang@onescreen.com) wrote:

> Hi all,
> 
> I'm trying to create an index with field routing.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/routing-field.html)
> 
> I already had the index has existed for a while without routing,  
> can I add field routing without rebuild the index? (example please..)
> 
> Another problem where should I put "\_routing" settings?
> 
> My index is named "sources", and the indexType is named "video".  
> should I put it inside "mappings", inside "video", or inside "sources"?  
> (I assume it should go inside "video", as it is a field with "store/index"  
> options as mentioned in the documentation.  
> however, the example makes me feel it should go under the indexName  
> "sources":
> 
> "comment" : {
> 
> ```
> "_routing" : {
> 
> "required" : true,
> 
> "path" : "blog.post_id"
> 
> ```
> 
> )
> 
> (The example also confused me as having no ' index' : 'not\_analyzed',  
> 'store': 'yes' inside \_routing, I assume they are the default value)
> 
> Here's how I did it:
> 
> curl -XPOST localhost:9200/sources -d '{
> 
> ```
> "mappings" : {
> "video" : {
> "_routing" : {
> "required" : true,
> "path" : "video.id"
> },
> "properties" : {
> 
> "id" : {
> "type" : "integer",
> "ignore_malformed" : false
> },
> ...
> 
> ```
> 
> Is this right?
> 
> in order to verify the index routing, how do I display the field \_routing  
> on an index?
> 
> Thank you.
> 
> Yuhan

--

---

<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:** [July 6, 2017, 3:09am UTC](https://discuss.elastic.co/t/about-display-field-routing/9296/3 "2017-07-06T03:09:30Z")

</div>


