Break down the Solr script in two parts