Skip to content

Commit b2bfb09

Browse files
committed
feat: Added binary ids support
1 parent 5583902 commit b2bfb09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ElasticEngine.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ public function map(Builder $builder, $results, $model)
348348
$ids[] = $hit['_source'][$scoutKeyName];
349349
}
350350

351+
if (method_exists($model, 'getBinaryColumns') && in_array($scoutKeyName, $model->getBinaryColumns())) {
352+
$ids = array_map(function ($id) {
353+
return hex2bin($id);
354+
}, $ids);
355+
}
356+
351357
$query = $model::usesSoftDelete() ? $model->withTrashed() : $model->newQuery();
352358

353359
$models = $query

0 commit comments

Comments
 (0)