Skip to content

Commit 7b8a3dd

Browse files
committed
1 parent dd36a06 commit 7b8a3dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Engines/TNTSearchEngine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ public function map(Builder $builder, $results, $model)
218218
}
219219

220220
// sort models by tnt search result set
221-
return $model->newCollection(collect($results['ids'])->map(function ($hit) use ($models) {
221+
return $model->newCollection(collect($results['ids'])->map(function ($hit, $key) use ($models, $results) {
222222
if (isset($models[$hit])) {
223-
return $models[$hit];
223+
return $models[$hit]->setAttribute('__tntSearchScore__', $results['docScores'][$hit]);
224224
}
225225
})->filter()->all());
226226
}

0 commit comments

Comments
 (0)