corrected the Deferred defn. for elasticssearch.js