refactored a solr query method