2013-08-28 19:24:34 -04:00
|
|
|
[[mapping-routing-field]]
|
|
|
|
=== `_routing`
|
|
|
|
|
|
|
|
The routing field allows to control the `_routing` aspect when indexing
|
2015-04-30 18:01:35 -04:00
|
|
|
data and explicit routing control is required. It is stored and indexed.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
[float]
|
|
|
|
==== required
|
|
|
|
|
|
|
|
Another aspect of the `_routing` mapping is the ability to define it as
|
|
|
|
required by setting `required` to `true`. This is very important to set
|
|
|
|
when using routing features, as it allows different APIs to make use of
|
|
|
|
it. For example, an index operation will be rejected if no routing value
|
2015-04-30 18:01:35 -04:00
|
|
|
has been provided.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
[float]
|
|
|
|
==== id uniqueness
|
|
|
|
|
|
|
|
When indexing documents specifying a custom `_routing`, the uniqueness
|
|
|
|
of the `_id` is not guaranteed throughout all the shards that the index
|
|
|
|
is composed of. In fact, documents with the same `_id` might end up in
|
|
|
|
different shards if indexed with different `_routing` values.
|