Fix elastic query