[TEST] Use array* helper assert methods instead of verifying the array directly
[TEST] Fixed intermittent failure due to lack of mapping
[Script] use a specialize variable resolver for _score in mvel scripts
Switch to Groovy as the default scripting language

This is a breaking change to move from MVEL -> Groovy

Conflicts:
	docs/reference/modules/scripting.asciidoc
Remove MVEL as a built-in scripting language

Conflicts:
	src/main/java/org/elasticsearch/script/mvel/MvelScriptEngineService.java
[DOCS] Remove merge conflict text that was left behind in scripting docs
Refactoring: Rename FieldMapper.termsFilter to fieldDataTermsFilter.

FieldMapper has two methods
`Filter termsFilter(List values, @Nullable QueryParseContext)` which is supposed
to work on the inverted index and
`Filter termsFilter(QueryParseContext, List, QueryParseContext)` which is
supposed to work on field data. Let's rename the second one to
`fieldDataTermsFilter` and remove the unused `QueryParseContext`.

Close #6888
[TEST] add trace logging for BWC snapshot/restore test
[Infra] remove indicesLifecycle.Listener from IndexingMemoryController

The IndexingMemoryController determines the amount of indexing buffer size and translog buffer size each shard should have. It takes memory from inactive shards (indexing wise) and assigns it to other shards. To do so it needs to know about the addition and closing of shards. The current implementation hooks into the indicesService.indicesLifecycle() mechanism to receive call backs, such shard entered the POST_RECOVERY state. Those call backs are typically run on the thread that actually made the change. A mutex was used to synchronize those callbacks with IndexingMemoryController's background thread, which updates the internal engines memory usage on a regular interval. This introduced a dependency between those threads and the locks of the internal engines hosted on the node. In a *very* rare situation (two tests runs locally) this can cause recovery time outs where two nodes are recovering replicas from each other.

 This commit introduces a a lock free approach that updates the internal data structures during iterations in the background thread.

Closes #6892
Revert "Netty: Refactoring to make MessageChannelHandler extensible"

This results in unstable tests, most likely due to Channels being mixed
up by wrongly creating the pipelines. Needs investigation and a test.

This reverts commit 1ce772a5ff4c7c5d53b9b53b6a927620b402eef9.
[Store] delete unallocated shards under a cluster state task

This is to prevent a rare racing condition where the very same shard gets allocated to the node after our sanity check that the cluster state didn't check and the actual deletion of the files.

Closes #6902
Added three frequency levels for resource watching

 It's now possible to register watchers along with a specified check frequency. There are three frequencies: low, medium, high. Each one is associated with a check interval that determines how frequent the watchers will check for changes and notify listeners if needed. By default, the intervals are 5s, 30s and 60s respectively, but they can also be customized in the settings. also:

  - Added the WatcherHandle construct by which one can stop it (remove it) and resume it (re add it). Also provices access to the watchers itself and the frequency by which it's checked
  - Change the default frequency to 30 seconds interval (used to be 60 seconds). The only watcher that is currently effected by this is the script watcher (now auto-loading scripts will auto-load every 30 seconds if changed)
[Bulk] Add blocking close method to BulkProcessor

Blocks until all bulk requests have completed.

Closes #4158
Closes #6314
[Bulk] Release semaphore again after close

The bulk processor tries to acquire all leases for the semaphore to wait
for all pending requests. Yet, we should release them afterwards again to
ensure we don't ever deadlock if there is a bug in the processor.
This commit also adds a testcase for this method
Return null info if service is not started

Closes #6906
[DOCS] Fixed typos
Term Vectors API: Computes term vectors on the fly if not stored in the index.

Adds the ability to the Term Vector API to generate term vectors for some
chosen fields, even though they haven't been explicitely stored in the index.

Relates to #5184
Closes #6567
[CLIENT] Unknown node version should be a lower bound

Today when we start a `TransportClient` we use the given transport
addresses and create a `DiscoveryNode` from it without knowing the
actual nodes version. We just use the `Version.CURRENT` which is an
upper bound. Yet, the other node might be a version less than the
currently running and serialisation of the nodes info might break. We
should rather use a lower bound here which is the version of the first
release with the same major version as `Version.CURRENT` since this is
what we officially support.

This commit moves to use the minimum major version or an RC / Snapshot
if the current version is a snapshot.

Closes #6894
[TEST] Randomize FS Translog implementation

Closes #6658
[TEST] Randomize Preference in search requests

Closes #6863