Modified for elasticsearch