我需要一种在太阳光solr中使用solr通配符的方法,或者有另一种方法从索引中指定“所有文档”,那么refining.Here就是代码。
....
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()发布于 2012-05-21 16:16:14
当然:正是出于这个原因,您可以只使用一个空的查询--这将起作用:
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'])https://stackoverflow.com/questions/10684870
复制相似问题