http = $http; } /** * Search persisted messages via the active search provider. * * Only `q` is required; every other filter is optional and null values are * dropped before the request is sent (so absent optionals are not serialized * into the query string). Numeric filters are passed through as-is; the * gateway coerces and validates them server-side. * * @param array{ * q:string, * sessionId?:string|null, * chatId?:string|null, * direction?:string|null, * type?:string|null, * from?:string|null, * dateFrom?:int|float|string|null, * dateTo?:int|float|string|null, * limit?:int|string|null, * offset?:int|string|null * } $params Query filters. `q` must be non-empty. * * @return array{ * hits:array>, * total:int, * tookMs:int, * provider:string * } Decoded SearchResults payload (empty array only on an unexpected null body). */ public function search(array $params): array { return $this->http->request('GET', '/api/search', $params) ?? []; } }