MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / check_solr

Function check_solr

test_haystack/utils.py:6–18  ·  view source on GitHub ↗
(using="solr")

Source from the content-addressed store, hash-verified

4
5
6def check_solr(using="solr"):
7 try:
8 from pysolr import Solr, SolrError
9 except ImportError:
10 raise unittest.SkipTest("pysolr not installed.")
11
12 solr = Solr(settings.HAYSTACK_CONNECTIONS[using]["URL"])
13 try:
14 solr.search("*:*")
15 except SolrError as e:
16 raise unittest.SkipTest(
17 "solr not running on %r" % settings.HAYSTACK_CONNECTIONS[using]["URL"], e
18 )

Callers 4

setUpMethod · 0.90
load_testsFunction · 0.85
load_testsFunction · 0.85
load_testsFunction · 0.85

Calls 1

searchMethod · 0.45

Tested by 1

setUpMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…