fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into sunburnt
[wolnelektury.git]
/
apps
/
search
/
custom.py
diff --git
a/apps/search/custom.py
b/apps/search/custom.py
index
788b6c4
..
86d387e
100644
(file)
--- a/
apps/search/custom.py
+++ b/
apps/search/custom.py
@@
-5,7
+5,7
@@
import urllib
import warnings
from sunburnt import search
import copy
import warnings
from sunburnt import search
import copy
-
+from httplib2 import socket
class TermVectorOptions(search.Options):
def __init__(self, schema, original=None):
class TermVectorOptions(search.Options):
def __init__(self, schema, original=None):
@@
-89,7
+89,11
@@
class CustomSolrInterface(sunburnt.SolrInterface):
self.writeable = False
elif 'r' not in mode:
self.readable = False
self.writeable = False
elif 'r' not in mode:
self.readable = False
- self.init_schema()
+ try:
+ self.init_schema()
+ except socket.error, e:
+ raise socket.error, "Cannot connect to Solr server, and search indexing is enabled (%s)" % str(e)
+
def _analyze(self, **kwargs):
if not self.readable:
def _analyze(self, **kwargs):
if not self.readable: