Handle error when ElasticSearch rejects query

[finishes #82248052]