Routing: Allow to define `path` on the `_routing` mapping, to automatically extract the routing from it #524

Closed
kimchy opened this Issue Nov 17, 2010 · 1 comment

Comments

Projects
None yet
1 participant
Owner

kimchy commented Nov 17, 2010

Allow to define a path for the _routing mapping, allowing to use a document field value as the routing value. The path allows for dot notation to access inner objects and fields. For example:

{
    "comment" : {
        "_routing" : {
            "required" : true,
            "path" : "blog.post_id"
        }
    }
}

The above will route the following document using the value "111222" :

{
    "text" : "the comment text"
    "blog" : {
        "id" : "111222"
    }
}

A note, when using _path and not providing the _routing specifically in the API, there might be an additional parsing stage to extract the routing before directing the operation to the relevant shard.

Also, there is a validation stage as well if the routing is provided as part of the API and a path is specified.

Owner

kimchy commented Nov 17, 2010

Routing: Allow to define path on the _routing mapping, to automatically extract the routing from it, closed by 44775c2.

medcl pushed a commit to medcl/elasticsearch that referenced this issue Jul 1, 2011

dadoonet pushed a commit to dadoonet/elasticsearch that referenced this issue Sep 4, 2015

Add compatibility with ES 2.0
Remove compatibility with ES 0.90

relates #524
relates #525

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment