Made p/c override the clone() method. This is necessary since by default clone will make a shallow copy of the original object, while for p/c queries we need to make sure that the wrapped queries are also cloned.
Make indexRandom handle many documents better

* Index one at a time only rarely if doing more then 300.
* When launching async actions, take some care to make sure you don't already
have more then 150 other async actions in flight.
* When indexing in bulk split into chunks of 1000 documents.
Speed up phrase suggestion scoring

Two changes:
1.  In the StupidBackoffScorer only look for the trigram if there is a bigram.
2.  Cache the frequencies in WordScorer so we don't look them up again and
again and again.  This is implemented by wrapping the TermsEnum in a special
purpose wrapper that really only works in context of the WordScorer.

This provides a pretty substantial speedup when there are many candidates.

Closes #5395
Move to use serial merge schedule by default
Today, we use ConcurrentMergeScheduler, and this can be painful since it is concurrent on a shard level, with a max of 3 threads doing concurrent merges. If there are several shards being indexed, then there will be a minor explosion of threads trying to do merges, all being throttled by our merge throttling.
Moving to serial merge scheduler will still maintain concurrency of merges across shards, as we have the merge thread pool that schedules those merges. It will just be a serial one on a specific shard.
Also, on serial merge scheduler, we now have a limit of how many merges it will do at one go, so it will let other shards get their fair chance of merging. We use the pending merges on IW to check if merges are needed or not for it.
Note, that if a merge is happening, it will not block due to a sync on the maybeMerge call at indexing (flush) time, since we wrap our merge scheduler with the EnabledMergeScheduler, where maybeMerge is not activated during indexing, only with explicit calls to IW#maybeMerge (see Merges).
closes #5447
Geo Point Fieldmapper: Allow distance for geohash precision

Even though mentioned differently in the docs, the geohash precision needed to
be an integer instead of a DistanceUnit.

Closes #5448
[TEST] Added the option to specify on what ES version a node should run with. Useful for testing.
BytesReference usage to properly work when hasArray is not available
when a BytesReference doesn't have a backing array, properly handle the case in places where its applicable
closes #5455
BytesReference usage to properly work when hasArray is not available
fix spelling in comment, + remove overcautious assert
Minor improvements to Table class and add tests
[Test] RecoveryWhileUnderLoadTests: smarter waiting for background indexers as it sometimes times out.
Invoke super.clone() instead of creating a new instance in the clone methods.
[DOCS] Updated Drupal integration
[DOCS] Fixed some bad UTF8
Use BytesReference to write to translog files
Instead of using byte arrays, pass the BytesReference to the actual translog file, and use the new copyTo(channel) method to write. This will improve by not potentially having to convert the data to a byte array
closes #5463
Significant_terms agg only creates term frequency cache when necessary and uses new TermsEnum wrapper to cache frequencies. Long and String-based aggs no longer need to pass an IndexReader as parameter when looking up frequencies of terms.
Closes #5459
Add exceptions to `GeoPointFieldMapper` when parsing `geo_point` object

* moved `geo_point` parsing to GeoUtils
* cleaned up `gzipped.json` for bulktest
* merged `GeoPointFieldMapper` and `GeoPoint` parsing methods

Closes #5390
Added segments action to _cat API
Currently displays the same information as the _segments API
Remove shard-level info from _cat/segments and add pri/rep and ip address to segments

Also fix typo

Closes #4711
[TEST] Disable wildcard query in testDfsSearchType for now
Fix cardinality memory-usage considerations.

Default precision was computed based on the number of MULTI_BUCKET parents
instead of PER_BUCKET.

The ordinals-based execution mode was almost always used although ordinals
might have non-negligible memory usage compared to the counters.

Close #5452