I think this may be a problem, since the Solr server runs on another machine and it being unavailable is a somewhat probable scenario. Maybe it would be better to try to index the document and, if not possible, mark it for indexing later. I'm not sure how much more work this would mean, but maybe having an attribute in the document ('indexed'  or something like that) and another script that runs periodically and indexes documents with this attribute set to False would be an approach that doesn't need to have 100% availability in the Solr server.