Added missing builder.endObject calls
Retry blocking if async indexing is rejected due to queue size

Some tests use AbstractIntegrationTest#indexRandom which sometimes uses async
indexing. This can easily run into queue size based rejections on a slow
box. In that case we should retry blocked indexing.
Randomly use Bulk in AbstractIntegrationTest#indexRandom
Segments API: Support merge id on segments (groups segments being merged)
Return a merge_id element in each segment of the segments API, allowing to group segments that are being merged as part of a single merge and indicate which ones are being merged now.
closes #3904
The `has_child` query's inner query now is wrapped in a filtered query with the child type as filter, this prevents other children from being returned as hit.
Extended the specialized simplified mapping source method to support metadata mapping fields. These fields can just specified as normal fields, but will automatically be placed as top level mapping field.

Closes #3818
fix naming in function_score

    - "boost" should be "boost_factor"
    - "mult" should be "multiply"

Also, store combine function names in ImmutableMap instead of iterating
over all possible names each time.

closes #3872 for master