Generate ElasticSearch queries from conditions