Cherry-pick of commit to 2.0 and updated to change version to 2.1.0 Original commit: elastic/x-pack-elasticsearch@8672bbf1b1
Original commit: elastic/x-pack-elasticsearch@15caf307c4