Skip to content

Commit

Permalink
search_options
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Aug 20, 2024
1 parent c17c2cd commit 8c95468
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Any additional settings you want to define per index can be included in the `sta
],
],
],
'query' => [
'search_options' => [
/*
Specify a custom sort by order, see the Typesense documentation for more info:
https://typesense.org/docs/guide/ranking-and-relevance.html#ranking-based-on-relevance-and-popularity
Expand Down
2 changes: 1 addition & 1 deletion src/Typesense/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function searchUsingApi($query, array $options = []): Collection
}

if (! isset($options['sort_by'])) {
if ($sort = Arr::get($this->config, 'settings.query.sort_by', false)) {
if ($sort = Arr::get($this->config, 'settings.search_options.sort_by', false)) {
$options['sort_by'] = $sort;
}
}
Expand Down

0 comments on commit 8c95468

Please sign in to comment.