Unclear about routing required mapping when deleting


#1

The docs state:
https://www.elastic.co/guide/en/elasticsearch/reference/2.2/docs-delete.html#delete-routing

Many times, the routing value is not known when deleting a document. For
those cases, when specifying the _routing mapping as required, and
no routing value is specified, the delete will be broadcast
automatically to all shards.

But in a separate section there seems to be a contradicting statement:
https://www.elastic.co/guide/en/elasticsearch/reference/2.2/breaking_20_crud_and_routing_changes.html#_delete_api_with_custom_routing

The delete API used to be broadcast to all shards in the index which meant
that, when using custom routing, the routing parameter was optional. Now,
the delete request is forwarded only to the shard holding the document. If you
are using custom routing then you should specify the routing value when
deleting a document, just as is already required for the index, create,
and update APIs.To make sure that you never forget a routing value, make routing required

Given a custom routing id:

  1. If you map routing as required and then do not submit a routing id during DELETE, does it broadcast to all shards, or does it fail?

  2. Alternatively, if you don't map routing as required, and then do not submit a routing id during DELETE, does it also broadcast, or does it fail?


#2

I've just tested scenario 1 in my original question on a node with 3 shards:
I've mapped routing to be required, and it does appear to delete the doc in questions whether I provide a routing id or not. So my guess is that yes, without a routing id the delete does broadcast to all shards.

Still unclear about scenario 2 though.


(system) #3