function highlight_keywords($text, $keywords, $highlighter = '<strong class="highlight">%s</strong>') { $h = new sfSolrHighlighter($text); $h->addKeywordSlug($keywords); $h->addHighlighter($highlighter); $h->hasBody(false); return $h->highlight(); }
protected function doHighlight($terms) { $content = $this->getContext()->getResponse()->getContent(); $lighter = new sfSolrHighlighter($content); $lighter->addKeywords($terms); $lighter->addHighlighters($this->getHighlightStrings()); $lighter->hasBody(true); $this->getContext()->getResponse()->setContent($lighter->highlight()); }