Best way to implement highlighting

51 views
Skip to first unread message

samuele.mattiuzzo

unread,
Jul 5, 2011, 8:34:27 AM7/5/11
to solrpy
i'm using this statement to query solr and get some highlighted
fields:

r = c.query('job_title:manager', fields=['job_title','job_content'],
highlight=True)

for h in r.highlighting.iteritems():
print h


and this is (part of) the response i get:

(u'http://www.totaljobs.com/JobSeeking/Manager_job50846522',
{
u'job_content': [u'<p>LEISURE / CATERING /\nRETAIL / HOTEL
BACKGROUND?&lt;/p&gt;\n &lt;p&gt;An exceptional\n<em>management</
em>'],
u'job_title': [u'<em>Manager</em>']
})
.
.
.
.

i'm not sure now how i can use this information inside my response
(and django) to visualize highlighted fields (i have the em class
defined in my css)
any suggestion?
Reply all
Reply to author
Forward
0 new messages