[3.9] Add compatibility with elasticsearch 1.0