Rewrote put to use elasticsearch-js