Tests: add verbosity to this test case
add verbose logging during index close
MLT Query: don't fetch unnecessary stats
Fix serialization of short[] arays.

short[] were mistakenly encoded as a float[]. This is not an issue for the
text-based xcontents that we have (yaml, json) since floats can represent any
short value and are serialized as strings. However, this will make the binary
xcontents serialize shorts as int instead of floats.

Close #7845
[SPEC] Separated the "Upgrade Index" API into two methods

* `get_upgrade` => `GET _upgrade`  -- Return the status
* `upgrade`     => `POST _upgrade` -- Perform the operation

Original specification part of c021f22523a69583b94c56921792b727ab4030fb.

Related: #7884, #7922
Tests: dump all thread stacks on failure
Tests: move thread stacks on failure to a RunListener, so it actually works
Aggregations: Fixes scripted metrics aggregation when used as a sub aggregation

The scripted metric aggregation is now a PER_BUCKET aggregation so that parent buckets are evaluated independently. Also the params and reduceParams are copied for each instance of the aggregator (each parent bucket) so modifications to the values are kept only within the scope of its parent bucket

Closes #8036
Docs: Remove the note that fielddata doesn't support filtering.

This particular note was about fielddata filtering but could cause confusion
that fields that have doc values enabled cannot be used for filtering (as in
a `filtered_query`).
[CORE] Log if CircuitBreaker is tripping

Today we only throw an exception which might not be logged at all. This
commit adds debug logging if we are tripping a CB.

Closes #8050
Spec: Added human flag to indices.get_upgrade
Add link to new upgrade docs from indices page.

See #7922.
Add forgotten include for upgrade docs.

See #7922
Revert Benchmark API in 1.x

The benchmark api is being worked on feature/bench branch and will be merged from there when ready.
Internal: fixed bw comp in ShardSearchTransportRequest

Original indices were introduced in 1.4.0.Beta1 as optional, preceded by a boolean flag that told whether they were empty or not. We have to keep serializing as optional only when reading and writing from/to 1.4.0.Beta1, although the original indices are not optional whenever we go and serialize the request they belong to (which is why the boolean got removed in 1.4.0).
Mapper: Throw exception if null_value is set to null

The mapping parser should throw an exception if "null_value" is set to `null`.

Fixes #7273

```bash
PUT /foo
{
  "mappings": {
    "bar": {
      "properties": {
        "exception": {
          "null_value": null,
          "type": "integer"
        }
      }
    }
  }
}
```
```
{
   "error": "MapperParsingException[mapping [bar]]; nested: MapperParsingException[Property [null_value] cannot be null.]; ",
   "status": 400
}
```
Aliases: Throw exception if index is null when creating 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.

Fixes #7976
Revert "Aliases: Throw exception if index is null when creating alias"

This reverts commit ca92987b9bfe5d635132f20ffbdd9aac089692db.
Docs: Tidied the upgrade indices docs
Rest: Added missing parameters to indices.upgrade