routing-field.asciidoc 824 B

12345678910111213141516171819202122
  1. [[mapping-routing-field]]
  2. === `_routing`
  3. The routing field allows to control the `_routing` aspect when indexing
  4. data and explicit routing control is required. It is stored and indexed.
  5. [float]
  6. ==== required
  7. Another aspect of the `_routing` mapping is the ability to define it as
  8. required by setting `required` to `true`. This is very important to set
  9. when using routing features, as it allows different APIs to make use of
  10. it. For example, an index operation will be rejected if no routing value
  11. has been provided.
  12. [float]
  13. ==== id uniqueness
  14. When indexing documents specifying a custom `_routing`, the uniqueness
  15. of the `_id` is not guaranteed throughout all the shards that the index
  16. is composed of. In fact, documents with the same `_id` might end up in
  17. different shards if indexed with different `_routing` values.