Fixed `Index.retrieve` so that it works with ES 1.0.0 and previous versions

Closes #939