Fix invalid strings in solr input (fixes #511)