ruflin/Elastica — pull request #631 by xyu (2014-06-11 16:37:52+00:00)
Title: Allow routing of bulk API actions

The elasticsearch bulk API allows for each item to have a [routing value](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html#bulk-routing
). This is especially helpful for bulk delete calls, which when set helps prevent those actions from being broadcast to all shards needlessly.

This change adds a optional parameter to the `deleteIds()` method which when set will route all deletes for the given id with the given routing value.

I also thought about perhaps allowing the ids array to be an array of id / routing key pairs however that seemed needlessly complicated and users can simply call `deleteIds()` multiple times with grouping ids with the same routing value if needed. (For our use case when we are bulk deleting by ids we are bulk deleting a bunch of related documents which are routed to the same shard.)