The DELETE /X/_doc/5 API is meant to delete a single document only. If your write alias did not have is_write_index: true on any of the indices (and still point to multiple indices), it would fail due to not being able to uniquely identify the doc to delete.
The request and response does not allow for multiple deletions. This makes it simple to use for the simple cases. For instance, the DELETE response includes information on the specific index the delete was done against as well as the version information for the document deleted.
_delete_by_query on the other hand runs a query against the alias and simply deletes all the resulting hits - against the specific indices returned in the search result.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.