Add support elasticsearch 1.x

elasticsearch 1.0 has got change for api url rules.
It is a patch to work with latest elasticsearch.