Added [1.4.0] version
Scripting: Add script engine for lucene expressions.

These are javascript expressions, which can only access numeric
fielddata, parameters, and _score. They can only be used for searches (not document updates).

closes #6818
[TEST] Enforce provided settings in test base classes

Enviorment variables might override the tests settings even if
they are explicitly set. Other base classes like InternalTestCluster
also specify `config.ignore_system_properties: true` to ensure `what
we set is what we get`
Test: make test less evil so it doesn't take so long
[TEST] Enforce that the node from ElasticsearchSingleNodeTest is alone in its cluster.

In particular, this removes the ability to create new node and adds the ability
to get a reference to the single node that the cluster is made of.
Docs: explain that SerialMergeScheduler just maps to CMS for back compat

Closes #6878
Mappings: Add transform to document before index.

Closes #6566
[FIX] normalize serialization of ScriptType in UpdateRequest
Fix transient testScore failure by making DF consistent for query.
Share numeric data analyzer instances between mappings
use similar mechanism that shares numeric analyzers for long/double/... for dates as well. This has nice memory save properties with many date fields mapping case, as well as analysis saves (thread local resources)
closes #6843
Releasable XContentBuilder
make the builder releasable (auto closeable), and use it in shards state
also make XContentParser releasable (AutoCloseable) and not closeable since it doesn't throw an IOException
closes #6869
[AGGS] Pass current docid being processed to scripts.

Scripts may internally cache based on docid (as expressions do). This
change makes numeric aggregations using scripts pass the docid when
it changes.
Store: Only send shard exists requests if shards exist locally on disk and are not allocated on that node according to the cluster state.

Closes #6870
[Infra] re-send failed shard messages when receiving a cluster state that still refers to them

In rare cases we may fail to send a shard failure event to the master, or there is no known master when the shard has failed (ex. a couple of node leave the cluster canceling recoveries and causing a master to step down at the same time). When that happens and a cluster state arrives from the (new) master we should resend the shard failure in order for the master to remove the shard from this node.

Closes #6881
[Recovery] don't start a gateway recovery if source node is not found

Due to change introduced in #6825, we now start a local gateway recovery for replicas, if the source node can not be found. The recovery then fails because we never recover replicas from disk.

Closes #6879
[TESTS] Stabilize DisabledFieldDataFormatTests by setting number_of_replicas to 0.
[DOCS] : Indexed scripts/templates

These are the docs for the indexed scripts/templates feature.
Also moved the namespace for the REST endpoints.

Closes #6851
[DOCS][FIX] Fix doc parsing, broken closing block
[DOCS][FIX] Fix reference check in indexed scripts/templates doc.
Aggregations: Fixed Histogram key_as_string bug

The key as string field in the response for the histogram aggregation will now only show if format is specified on the request.

Closes #6655