Skip to content

Commit

Permalink
Allow Typesense Search Parameter Definition on Models (#827)
Browse files Browse the repository at this point in the history
* Allow Typesense Search Parameter Definition on Models

* Added Parameters to array_merge
  • Loading branch information
stammbach authored May 6, 2024
1 parent 9df008e commit e8fa704
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Engines/TypesenseEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ public function buildSearchParameters(Builder $builder, int $page, int|null $per
'highlight_affix_num_tokens' => 4,
];

if (method_exists($builder->model, 'typesenseSearchParameters')) {
$parameters = array_merge($parameters, $builder->model->typesenseSearchParameters());
}

if (! empty($builder->options)) {
$parameters = array_merge($parameters, $builder->options);
}
Expand Down

0 comments on commit e8fa704

Please sign in to comment.