fix python script to work better across all solr versions