[TEST] use higher timeout to wait for balanced cluster

CorruptFileTest sometimes hits conditions where lots of rebalancing
happens. In such a case the default timeout is just not enough - this
timeout just makes sure that the cluster has enough time to balance
itself.
Add version check before reading script type in UpdateRequest
Indexed Scripts/Templates: cleanup

This commit cleans up some code around the indexed script/templates feature.
Remove dead code in ScriptService.
Remove setXScript methods for UpdateRequestBuilder and use setScript(script,type) instead
Added missing version based serialization
[TEST] Fix test to use keyword analyzer since it relies on exact terms without processing
[SEARCH] Wrap filter only once in ApplyAcceptedDocsFilter

We potentially wrap the given filter multiple times when iterating the
subreaders. We only need to do this once.

Closes #6873
Core: don't close/reopen IndexWriter when changing RAM buffer size

Today we close/reopen IW when we change the RAM buffer but that's
costly because it means the next NRT reader is a full reopen.  The RAM
buffer size setting is a live one in IndexWriter, even if there are no
buffered docs in RAM when you call it.

Separately it would be nice if Lucene let you manage a "reader pool"
that could outlive individual IW instances ...

Closes #6856
Internal: make transport action name available in TransportAction base class

Each transport action is associated with at least an action name, which is the action name that gets serialized together with the request and identifies what to do with the request itself. Also, the action name is the name of the registered transport handler that handles incoming request for the transport action.

This commit makes the action name available in a generic manner in the TransportAction base class, so that it can be used when needed by subclasses, or in the base class for instance for action filtering.

Closes #6860
[UPDATE] Handle document missing exception on retry correctly.

Throwables thrown on update retries are now caught and handled via
the provided callback. This commit also contains an integration test
demonstrating the bug and validating the fix.

Closes #6355
Closes #6724
[TESTS] Add ElasticsearchSingleNodeTest.

This test makes it easy to create a lightweight node (no http, indices stored
in RAM, ...) whose main purpose is to get an instance of the Guice injector
for unit tests.

This should help not have to update lots of unit tests when we add a new
Guice dependency.
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