elasticsearch/elasticsearch — pull request #8240 by polyfractal (2014-10-27 15:14:14+00:00)
Title: Aliases: Throw exception if index is null or missing when creating an alias

Fixes a bug where alias creation would allow `null` for index name, which thereby applied the alias to _all_ indices. This patch makes the validator throw an exception if the index is null.

Java integration tests and YAML REST tests had to be modified, since they were testing this bug as if it were a real feature.

This is a **breaking** change, if someone was accidentally relying on this bug.

Fixes #7863, related to old PR #7976

```bash
POST /_aliases
{
"actions": [
{
"add": {
"alias": "empty-alias",
"index": null
}
}
]
}
```
```json
{
"error": "ActionRequestValidationException[Validation Failed: 1: Alias action [add]: [index] may not be null;]",
"status": 400
}
```