Closes #5882
[TEST] Randomized number of replicas between 0 and the number of data nodes - 1 (rather than just between 0 and 1)

Closes #5896
Include name of the field that caused a circuit break in the log and exception message

Fixes #5718
Closes #5841
[DOCS] rewrite -> fuzzy_rewrite in match query
Fixed typo
[TEST] add a test that explicitly verifies no duplicates are created
we do this test in other places in ES, but no dedicated test for it. This test was born out of the auto generate id work, but we should have this test regardless if it gets in or not
Add REST API spec for /_search_shards endpoint

Also adds REST test for /_search_shards

Closes #5907
Field data diet.

We have lots of unused, or almost unused methods in our field data impls,
especially when dealing with ordinals. Let's nuke them.

Close #5874
Remove abstraction in the percentiles aggregation.

We initially added abstraction in the percentiles aggregation in order to be
able to plug in different percentiles estimators. However, only one of the 3
options that we looked into proved useful and I don't see us adding new
estimators in the future.

Moreover, because of this, we let the parser put unknown parameters into a hash
table in case these parameters would have meaning for a specific percentiles
estimator impl. But this makes parsing error-prone: for example a user reported
that his percentiles aggregation reported extremely high (in the order of
several millions while the maximum field value was `5`), and the reason was that
he had a typo and had written `fields` instead of `field`. As a consequence,
the percentiles aggregation used the parent value source which was a timestamp,
hence the large values. Parsing would now barf in case of an unknown parameter.

Close #5859
Fail a DFS_QUERY_THEN_FETCH request if all shards failed the QUERY phase.

Today, if some shards pass the DFS phase but all of them fail the QUERY phase,
the response will only consist of failed shards. We should throw an exception
instead in order to be consistent with the QUERY_THEN_FETCH type.
Instantiate facets/aggregations during the QUERY phase.

In case of a DFS_QUERY_THEN_FETCH request, facets and aggregations are currently
instantiated during the DFS phase while they only become useful during the QUERY
phase. By instantiating during the QUERY phase instead, we can make better use
of recycling since objects will have a shorter life out of the recyclers.

Close #5821
[TEST] DisabledFieldDataFormatTests assumes a single replica.
Throw exception if decay is requested for a field with multiple values

closes #3960
Revert "Throw exception if decay is requested for a field with multiple values"

This reverts commit 95d781510f9ec66b6615df4e26ccc18da9c2b155.

see https://github.com/elasticsearch/elasticsearch/issues/3960#issuecomment-41279373
Update keyword-repeat-tokenfilter.asciidoc
test was missing tie-break for the two suggestions
Add some more documentation to TemplateQueryParser

Relates to #4879
[TEST] Allow to disable randomization of shards and replicas via system property

Needed for REST backwards compatibility tests, since we need to run older tests with the latest runner, which randomizes shards and replicas, but the tests rely on defaults (5,1).

Done in a generic way based on compatibility versions e.g. `-Dtests.compatibility=1.0.0` allows to run tests in a special manner that is compatibile with 1.0.0 version.

Also moved back randomIndexTemplate to ElasticsearchIntegrationTest (from ImmutableCluster) where all the randomized aspects should be.

Closes #5897
Send Lucene's IndexWriter infoStream messages to Logger lucene.iw, level=TRACE

Lucene's IndexWriter logs many low-level details to its infoStream
which can be helpful for diagnosing; with this change, if you enable
TRACE logging for the "lucene.iw" logger name then IndexWriter's
infoStream output will be captured and can later be scrutinized
e.g. using https://code.google.com/a/apache-extras.org/p/luceneutil/source/browse/src/python/iwLogToGraphs.py
to generate graphs like http://people.apache.org/~mikemccand/lucenebench/iw.html

Closes #5891
Remove java6ism in FSTBytesAtomicFieldData.
[TEST] Fix typo in DateHistogramTests that fails the test since it expects dates to be rounded by day.