【发布时间】:2019-08-12 14:09:49
【问题描述】:
如果我想用python在Django中实现Solr的高亮功能,如何使用包 solrpy?
solrpy 是如何处理它的,因为突出显示的结果存在于 SolrResponse 对象上的绝对片段中,显示为字典字典。
此外,solrpy 是否仍然适用于 solr 的更多功能,例如分面、突出显示和其他东西,除了基本查询
sc = solr.SolrConnection("http://localhost:8080/solr/cases")
response_c=sc.query('name:*%s'%q+'*',fields='name,decision_date', highlight='name')
print(response_c.results)
for hit in response_c.results:
print(hit)
为什么上面的代码不能实现高亮?
【问题讨论】:
标签: python django solr highlight