Skip to content

Commit 8a379c0

Browse files
authored
Merge pull request #8 from alexkovt/feat/binary-ids-support
feat: Added binary ids support
2 parents 5583902 + b2bfb09 commit 8a379c0

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)