OpenSearch/docs
Zachary Tong f5b2dfd052 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.

```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
}
```

The reason this bug wasn't caught by the existing tests is because
the old test for nullness only validated against a cluster which had
zero indices.  The null index is translated into "_all", and since
there are no indices, this fails because the index doesn't exist.
 So the test passes.

However, as soon as you add an index, "_all" resolves and you get the
situation described in the original bug report:  null index is
accepted by the alias, resolves to "_all" and gets applied to everything.

The REST tests, otoh, explicitly tested this bug as a real feature and therefore
passed.  The REST tests were modified to change this behavior.

Fixes #7863
2014-10-27 14:39:01 -04:00
..
community Docs: Adding community-contributed Scout plugins 2014-10-16 16:47:08 +02:00
groovy-api Updated groovy docs to point to the new groovy repo 2014-05-14 12:08:02 +02:00
java-api Docs: Some Data Cant't be obtained. 2014-10-17 15:20:33 +02:00
javascript added doc page for the JavaScipt client, and listed it in the clients list. 2013-12-17 15:26:29 -07:00
perl [DOCS] Updated the Perl docs 2014-03-09 19:45:16 +01:00
python [DOCS] adding a note on python client versioning schema 2014-02-11 03:43:53 +01:00
reference Aliases: Throw exception if index is null or missing when creating an alias 2014-10-27 14:39:01 -04:00
resiliency Docs: Updated the resiliency docs to point to the DiscoveryWithServiceDisruptions class 2014-10-02 21:08:32 +02:00
river [DOCS] Fixed typo 2013-10-05 17:10:30 +02:00
ruby [DOC] Added comprehensive documentation for the Ruby and Rails integrations 2014-07-10 11:21:27 +02:00
README.md [DOCS] various docs fixes 2014-01-23 10:52:13 +01:00

README.md

The Elasticsearch docs are in AsciiDoc format and can be built using the Elasticsearch documentation build process

See: https://github.com/elasticsearch/docs