added middleware elasticsearch to resources