Upgraded for elasticsearch 1.2.0