Changed hunspell token filter factory to use "dedup = true" by default
Properly cache parent/child queries in the case they are wrapped in a compound filter.
Closes #2971
Added tests for hunspell token filter factory
Use current settings as default in BalancedShardsAllocator instead of defaults.
Custom settings are not always present in the `Settings` that are passed
to `NodeSettingsService.Listener#onRefreshSettings` such that using the defaults
will necessarily override the custom settings if set before.

Closes #2973
Use less agressive threshold to prevent primary relocation in recovery test
Added a first small set of hamcrest matchers

A first implementation of adding matchers and helper methods to elasticsearch.
The following ones are supported

assertHitCount(searchResponse, 2);

// helper methods to easily access the first hits
assertFirstHit(searchResponse, hasId("foo")):
assertSecondHit(searchResponse, hasType("foo")):
assertThirdHit(searchResponse, hasIndex("foo")):

// methods to access all other hits
assertSearchHit(searchResponse, 5, hasId("10"));
// same as above, but maybe more readable
assertSearchHit(searchResponse.getHits().getAt(5), hasIndex("foo"));

I changed GeoFilterTests to show how it works.

Furthermore I inlined assertHighlight() from HighlighterSearchTests.
The ElasticsearchAssertions class can be used now as a centralized assertion class
in order have a centralized class for every developer to look at.
Introduced a Opertaion enum that is passed to each call of
WeightFunction#weight to allow dedicated weight calculations per operation. In certain
circumstance it is more efficient / required to ignore certain factors in the weight
calculation to prevent for instance relocations if they are solely triggered by tie-breakers.
In particular the primary balance property should not be taken into account if the delta for
early termination is calculated since otherwise a relocation could be triggered solely by the
fact that two nodes have different amount of primaries allocated to them.

Closes #2984
Improve stability of SimpleDataNodesTests

Make sure that we are waiting for the new state to be propagated to the node where we are executing the followup query that depends on this state.
Support SpanMultiTerm, closes #2610, #2400

This adds support for lucene span multi term queries. This lucene query
allows users to form complicated queries such as wildcards or prefix
queries embedded within span queries.
Refactoring SpanMultiTermQuery support

* Added license headers where needed
* Refactored SpanMultiTermQueryParser
* Refactored tests to adhere to other tests
Fixed issue where 'fast' should filter can make documents that didn't match the must or must_not clause a match again. Relates to #2979
A neater approach of for processing should clauses before must or must_not clauses.
Accept loopback interfaces in the network.host setting

Closes #2924. Adds support for loopback interfaces such as _lo0_ in network.host and other network settings.
Use full ord range in binary search. The upperbound of the binary search in
BytesRefOrdValComparator starts at 1 and ends at maxOrd - 1. Yet, numOrd is defined
as maxOrd - 1 excluding the 0 ord.

This causes wrong sort ords when the bottom of the queue is compared to the next
segment and the greatest term in the new segment is in-fact less than the current
queue bottom. If that is true we treat the values as equal and never include the right
value into the queue.

Closes #2991
Expose Lucene Main Version via Main Action. A call to `/` will
return the version of the used Lucene library next to the Elasticsearch
version.

Closes #2988
Added support for Collections in TermsQuery/InQuery.