diff --git a/apachesolr_search.module b/apachesolr_search.module index 87a2892..ba77d6f 100644 --- a/apachesolr_search.module +++ b/apachesolr_search.module @@ -605,8 +605,8 @@ function apachesolr_search_process_response($response, $query, $params) { foreach ($hl_fl as $hl_param) { if (isset($response->highlighting->{$doc->id}->$hl_param)) { // Merge arrays preserving keys. - foreach ($response->highlighting->{$doc->id}->$hl_param as $values) { - $snippets[$hl_param] = $values; + foreach ($response->highlighting->{$doc->id}->$hl_param as $value) { + $snippets[$hl_param][] = $value; } } } @@ -1541,16 +1541,16 @@ function theme_apachesolr_currentsearch($total_found, $links) { function theme_apachesolr_search_snippets($doc, $snippets = array()) { $result = ''; if (isset($snippets['body'])) { - $result .= $snippets['body']; + $result .= implode(' ... ', $snippets['body']); unset($snippets['body']); } if (isset($snippets['teaser'])) { $result .= (strlen($result) > 0) ? ' ... ' : ''; - $result .= $snippets['teaser']; + $result .= implode(' ... ', $snippets['teaser']); unset($snippets['teaser']); } $result .= (strlen($result) > 0) ? ' ... ' : ''; - return $result . implode(' ... ', $snippets) . ' ...'; + return $result; } /**