pub struct SearchService { /* private fields */ }search-service only.Expand description
Implements a client for the Discovery Engine API.
§Example
let client = SearchService::builder().build().await?;
// use `client` to make requests to the Discovery Engine API.§Service Description
Service for search.
§Configuration
To configure SearchService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://discoveryengine.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
SearchService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap SearchService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl SearchService
impl SearchService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for SearchService.
let client = SearchService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: SearchService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: SearchService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn search_lite(&self) -> SearchLite
pub fn search_lite(&self) -> SearchLite
Performs a search. Similar to the SearchService.Search method, but a lite version that allows API key for authentication, where OAuth and IAM checks are not required.
Only public website search is supported by this method. If data stores and
engines not associated with public website search are specified, a
FAILED_PRECONDITION error is returned.
This method can be used for easy onboarding without having to implement an authentication backend. However, it is strongly recommended to use SearchService.Search instead with required OAuth and IAM checks to provide better data security.
Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
Sourcepub fn cancel_operation(&self) -> CancelOperation
pub fn cancel_operation(&self) -> CancelOperation
Provides the Operations service functionality in this service.
Trait Implementations§
Source§impl Clone for SearchService
impl Clone for SearchService
Source§fn clone(&self) -> SearchService
fn clone(&self) -> SearchService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more