diff --git a/src/Endpoints/Delegates/HandlesMultiSearch.php b/src/Endpoints/Delegates/HandlesMultiSearch.php index d1312f19..ecb1b3f3 100644 --- a/src/Endpoints/Delegates/HandlesMultiSearch.php +++ b/src/Endpoints/Delegates/HandlesMultiSearch.php @@ -22,6 +22,10 @@ public function multiSearch(array $queries = [], ?MultiSearchFederation $federat $body[] = $query->toArray(); } - return $this->http->post('/multi-search', ['queries' => $body, 'federation' => $federation->toArray()]); + $payload = ['queries' => $body]; + if ($federation !== null) { + $payload['federation'] = $federation->toArray(); + } + return $this->http->post('/multi-search', $payload); } }