Update elasticsearch.js

Handle non plain _type or _id