SuggestClient
open class SuggestClient : SuggestClientProtocol, @unchecked Sendable
A client for the merino suggest endpoint.
Use [SuggestClient::new] to create an instance, then call
[SuggestClient::get_suggestions] to fetch suggestions for a query.
-
Creates a new
SuggestClientfrom the given configuration.Declaration
Swift
public convenience init(config: SuggestConfig) throws -
Fetches suggestions from the merino suggest endpoint for the given query.
Returns the raw JSON response body as a string, or
Noneif the server returned HTTP 204 (no suggestions available for weather).Declaration
Swift
open func getSuggestions(query: String, options: SuggestOptions) throws -> String?