| 
  | highlight(self,
        text,
        query,
        hl,
        strip_tags=False)
   | source code |  Add highlights (string prefix/postfix) to a string. textis the source to highlight.queryis either a Xapian query object or a list of (unstemmed) term strings.hlis a pair of highlight strings, e.g. ('<i>', '</i>')strip_tagsstrips HTML markout iff True
 
>>> hl = Highlighter()
>>> qp = xapian.QueryParser()
>>> q = qp.parse_query('cat dog')
>>> tags = ('[[', ']]')
>>> hl.highlight('The cat went Dogging; but was <i>dog tired</i>.', q, tags)
'The [[cat]] went [[Dogging]]; but was <i>[[dog]] tired</i>.'
   |