Sunburnt solr * pattern: *

I need a way to use the solr template: in sunburnt solr, or is there another way to specify "all documents" from the index, and then clarify. Here is the code

....
si = sunburnt.SolrInterface(url=solr_url,http_connection=h)
search_terms = {SEARCH_TERMS_COMIN_FROM_A_FORM}

#!This is where I need help!
result = si.query(WILDCARD)#I need all the docs from the index

#then I can do this
if search_terms['province']:
    result = result.query(province=search_terms['province'])
if search_terms['town']:
    result = result.query(town=search_terms['town'])
.......#two other similar if statement blocks
#finally
results = result.execute()
+3
source share
1 answer

Of course: for this reason you can just use an empty query - this will work:

result = si.query()

if search_terms['province']:
    result = result.query(province=search_terms['province'])
if search_terms['town']:
    result = result.query(town=search_terms['town'])
+6
source

All Articles