You are here

protected function SearchApiSolrService::formatHighlighting in Search API Solr 7

Changes highlighting tags from our custom, HTML-safe ones to HTML.

Parameters

string|string[] $snippet: The snippet(s) to format.

Return value

string|string[] The snippet(s), properly formatted as HTML.

2 calls to SearchApiSolrService::formatHighlighting()
SearchApiSolrService::getExcerpt in includes/service.inc
Extract and format highlighting information for a specific item from a Solr response.
SearchApiSolrService::sanitizeAndFormatExcerptSnippet in includes/service.inc

File

includes/service.inc, line 1533

Class

SearchApiSolrService
Search service class using Solr server.

Code

protected function formatHighlighting($snippet) {
  $search = array(
    '[HIGHLIGHT]',
    '[/HIGHLIGHT]',
  );
  return str_replace($search, $this
    ->getHighlightingPrefixSuffix(), $snippet);
}