Close elastic/elasticsearch#404 Original commit: elastic/x-pack-elasticsearch@1250e1449e
Original commit: elastic/x-pack-elasticsearch@1f439bb5e9