I'm not familiar with the Solr PHP client but I'd like to make sure line 39 and 40 don't need to have any sort of escaping of the $fields hash keys and values.

Ignore if it doesn't.