Skip to content

Commit af90e05

Browse files
authored
Return the search highlight (#28)
2 parents ddcff6d + 8908a02 commit af90e05

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Typesense/Index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public function searchUsingApi($query, array $options = []): array
134134
->map(function ($result, $i) use ($total) {
135135
$result['document']['reference'] = $result['document']['id'];
136136
$result['document']['search_score'] = Arr::get($this->config, 'settings.maintain_ranking', false) ? ($total - $i) : (int) ($result['text_match'] ?? 0);
137+
$result['document']['search_highlight'] = $result['highlight'] ?? [];
137138

138139
return $result['document'];
139140
}),

0 commit comments

Comments
 (0)