finally works with latest version of mongo and elasticsearch