Transforms a complex query into a solr filter expression.