function theme_apachesolr_search_snippets in Apache Solr Search 6.2
Same name and namespace in other branches
- 8 apachesolr_search.module \theme_apachesolr_search_snippets()
- 5.2 apachesolr_search.module \theme_apachesolr_search_snippets()
- 6.3 apachesolr_search.module \theme_apachesolr_search_snippets()
- 6 apachesolr_search.module \theme_apachesolr_search_snippets()
- 7 apachesolr_search.module \theme_apachesolr_search_snippets()
Theme the highlighted snippet text for a search entry.
Parameters
object $doc:
array $snippets:
1 theme call to theme_apachesolr_search_snippets()
File
- ./
apachesolr_search.module, line 1541 - Provides a content search implementation for node content for use with the Apache Solr search application.
Code
function theme_apachesolr_search_snippets($doc, $snippets = array()) {
$result = '';
if (isset($snippets['body'])) {
$result .= $snippets['body'];
unset($snippets['body']);
}
if (isset($snippets['teaser'])) {
$result .= strlen($result) > 0 ? ' ... ' : '';
$result .= $snippets['teaser'];
unset($snippets['teaser']);
}
$result .= strlen($result) > 0 ? ' ... ' : '';
return $result . implode(' ... ', $snippets) . ' ...';
}