Skip to content

Commit 390eadb

Browse files
authored
Surface highlight (#27)
2 parents 2ee7134 + 6e7e47c commit 390eadb

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)