Skip to content

Commit 89b744c

Browse files
committed
Fix query_by in search options being overwritten
1 parent 6398106 commit 89b744c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Typesense/Index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ public function searchUsingApi($query, array $options = []): array
9898
{
9999
$options['q'] = $query ?? '';
100100

101+
$options = array_merge(Arr::get($this->config, 'settings.search_options', []), $options);
102+
101103
if (! isset($options['query_by'])) {
102104
$schema = Arr::get($this->config, 'settings.schema', []);
103105

@@ -109,7 +111,7 @@ public function searchUsingApi($query, array $options = []): array
109111
->join(',') ?: '*';
110112
}
111113

112-
$searchResults = $this->getOrCreateIndex()->documents->search(array_merge(Arr::get($this->config, 'settings.search_options', []), $options));
114+
$searchResults = $this->getOrCreateIndex()->documents->search($options);
113115

114116
$total = count($searchResults['hits']);
115117

0 commit comments

Comments
 (0)