Correcting ES query