You are here

protected function SearchApiSolrService::getHighlightingPrefixSuffix in Search API Solr 7

Returns the prefix and suffix for highlighting matches in the excerpt.

Return value

string[] An array of 2 items, prefix and suffix.

1 call to SearchApiSolrService::getHighlightingPrefixSuffix()
SearchApiSolrService::formatHighlighting in includes/service.inc
Changes highlighting tags from our custom, HTML-safe ones to HTML.

File

includes/service.inc, line 1544

Class

SearchApiSolrService
Search service class using Solr server.

Code

protected function getHighlightingPrefixSuffix() {
  $prefix = '<strong>';
  $suffix = '</strong>';
  if (!empty($this->options['highlight_prefix'])) {
    $prefix = $this->options['highlight_prefix'];
  }
  if (!empty($this->options['highlight_suffix'])) {
    $suffix = $this->options['highlight_suffix'];
  }
  return array(
    $prefix,
    $suffix,
  );
}