Fix query for Elasticsearch 1.4