fix to work with elasticsearch 1.0+