# HG changeset patch # User dwinter # Date 1372314560 -7200 # Node ID f7fe88804cb869bc36e509cc1fd86810996a7d02 # Parent 74a9661e4e9fdc4ec82261c8554223d2df6dc232# Parent 896bea4f61a00f3771c92a66fe55af7826974fa7 Merge with 896bea4f61a00f3771c92a66fe55af7826974fa7 diff -r 74a9661e4e9f -r f7fe88804cb8 zopeSolr.py --- a/zopeSolr.py Thu Jun 27 08:28:45 2013 +0200 +++ b/zopeSolr.py Thu Jun 27 08:29:20 2013 +0200 @@ -15,6 +15,7 @@ import xml.etree.ElementTree as ET import json import random +import logging #Worte die nicht in der Termliste angezeigt werden sollen #TODO: make this configurable @@ -67,7 +68,11 @@ if not getattr(self,'_v_solr_',None): - self.connect() + try: + self.connect() + except Exception, e: + logging.error("Error connecting to Solr: %s"%e) + return [] #http://localhost:8983/solr/mpiwgSources/select/?q=*:*&sort=random_12xs34%20desc&rows=1&facet=false @@ -183,9 +188,11 @@ # fls[fl]={} if not getattr(self,'_v_solr_',None): - self.connect() - - + try: + self.connect() + except Exception, e: + logging.error("Error connecting to Solr: %s"%e) + return res for x in range(begin,end,increment): query={} @@ -309,9 +316,11 @@ #teste verbindung zu solr if not getattr(self,'_v_solr_',None): - self.connect() - - + try: + self.connect() + except Exception, e: + logging.error("Error connecting to Solr: %s"%e) + return [] solrQuery = solrQuery.decode('utf-8')