Add compatibility with elasticsearch 1
Merge pull request #1022 from romainneutron/elastic-search-1.0

[3.9] Add compatibility with elasticsearch 1.0