Skip to content

Commit 3684244

Browse files
authored
Merge pull request #347 from it4need/patch-1
🐛 fixing #342 again
2 parents c82479b + b5f3788 commit 3684244

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,11 +218,11 @@ public function map(Builder $builder, $results, $model)
218218
}
219219

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

228228
/**

0 commit comments

Comments
 (0)