Internal: remove ForceSyncDirectory

Historical code, not used anymore.

Closes #7804
Core: Check if from + size don't cause overflow and fail with a better error.

Closes #7778
Discovery: Give a unique id to each ping response

During discovery a node gossips with other nodes to discover the current state of the cluster - what nodes are out there, what version they use and most importantly whether there is an active master out there. During this ping process we may end up in a situation where old information is mixed with new. This is comment if a couple of master election happen in rapid succession.

This commit adds a monotonically increasing id to each ping response. This makes it easy to always select the last ping from every node.

Closes #7769
Test: RecoveryWhileUnderLoadTests.recoverWhileRelocating should report cluster state when failing to reach green
Recovery: mapping check during phase2 should be done in cluster state update task

Before phase2 we check verify that the local mapping is in sync with the cluster state mapping (and send & wait on a master update mapping task if not). This check should be done under a cluster state update task to make sure an incoming cluster state update to do not change things while we check.

Closes #7744
Tests: extend testRecoverFromPreviousVersion to sometimes index during relocation

Relates to #7729

Closes #7768
Update java source example

From the version 1.0 FilterBuilders and QueryBuilders are not part from org.elasticsearch.index.query.xcontent package no more.

Closes #7701.

(cherry picked from commit 32d4200)
Apply bulk change to 1.3.3

relates to #7729
Docs: IndexResponse.matches() does not exist anymore

Since 1.0, percolator has been redesigned so percolator is not applied anymore at index time.

Closes #7548.
script with _score: remove dependency of DocLookup and scorer

As pointed out in #7487 DocLookup is a variable that is accessible by all scripts
for one doc while the query is executed. But the _score and therfore the scorer
depends on the current context, that is, which part of query is currently executed.
Instead of setting the scorer for DocLookup
and have Script access the DocLookup for getting the score, the Scorer should just
be explicitely set for each script.
DocLookup should not have any reference to a scorer.
This was similarly discussed in #7043.

This dependency caused a stackoverflow when running script score in combination with an
aggregation on _score. Also the wrong scorer was called when nesting several script scores.

closes #7487