Skip to content

Commit 6e7e47c

Browse files
committed
Surface highlight
1 parent 2ee7134 commit 6e7e47c

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
@@ -122,6 +122,7 @@ public function searchUsingApi($query, array $options = []): array
122122
->map(function ($result, $i) use ($total) {
123123
$result['document']['reference'] = $result['document']['id'];
124124
$result['document']['search_score'] = Arr::get($this->config, 'settings.maintain_ranking', false) ? ($total - $i) : (int) ($result['text_match'] ?? 0);
125+
$result['document']['search_highlight'] = $result['highlight'] ?? [];
125126

126127
return $result['document'];
127128
}),

0 commit comments

Comments
 (0)