protected function Highlight::getEllipses in Search API 8
Retrieves the translated separators for excerpts.
Defaults to Unicode ellipses (…) on all positions.
Return value
string[] A numeric array containing three elements: the separator to put at the front of the excerpt (if that is not the front of the string), the separator to put in between different portions of the text, and the separator to append at the end of the excerpt if it doesn't end with the end of the text.
1 call to Highlight::getEllipses()
- Highlight::createExcerpt in src/
Plugin/ search_api/ processor/ Highlight.php - Returns snippets from a piece of text, with certain keywords highlighted.
File
- src/
Plugin/ search_api/ processor/ Highlight.php, line 665
Class
- Highlight
- Adds a highlighted excerpt to results and highlights returned fields.
Namespace
Drupal\search_api\Plugin\search_api\processorCode
protected function getEllipses() {
// Combine the text chunks with "…" separators. The "…" needs to be
// translated. Let translators have the … separator text as one chunk.
$ellipses = explode('@excerpt', $this
->t('… @excerpt … @excerpt …'));
return $ellipses;
}