#[non_exhaustive]pub struct SearchResponse {Show 13 fields
pub results: Vec<SearchResult>,
pub facets: Vec<Facet>,
pub total_size: i32,
pub attribution_token: String,
pub redirect_uri: String,
pub next_page_token: String,
pub corrected_query: String,
pub summary: Option<Summary>,
pub query_expansion_info: Option<QueryExpansionInfo>,
pub natural_language_query_understanding_info: Option<NaturalLanguageQueryUnderstandingInfo>,
pub session_info: Option<SessionInfo>,
pub search_link_promotions: Vec<SearchLinkPromotion>,
pub semantic_state: SemanticState,
/* private fields */
}conversational-search-service or search-service only.Expand description
Response message for SearchService.Search method.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.results: Vec<SearchResult>A list of matched documents. The order represents the ranking.
facets: Vec<Facet>Results of facets requested by user.
total_size: i32The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.
attribution_token: StringA unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.
redirect_uri: StringThe URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.
next_page_token: StringA token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
corrected_query: StringContains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.
summary: Option<Summary>A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.
query_expansion_info: Option<QueryExpansionInfo>Query expansion information for the returned results.
natural_language_query_understanding_info: Option<NaturalLanguageQueryUnderstandingInfo>Output only. Natural language query understanding information for the returned results.
session_info: Option<SessionInfo>Session information.
Only set if SearchRequest.session is provided. See its description for more details.
search_link_promotions: Vec<SearchLinkPromotion>Promotions for site search.
semantic_state: SemanticStateOutput only. Indicates the semantic state of the search response.
Implementations§
Source§impl SearchResponse
impl SearchResponse
Sourcepub fn set_results<T, V>(self, v: T) -> Self
pub fn set_results<T, V>(self, v: T) -> Self
Sourcepub fn set_facets<T, V>(self, v: T) -> Self
pub fn set_facets<T, V>(self, v: T) -> Self
Sourcepub fn set_total_size<T: Into<i32>>(self, v: T) -> Self
pub fn set_total_size<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_attribution_token<T: Into<String>>(self, v: T) -> Self
pub fn set_attribution_token<T: Into<String>>(self, v: T) -> Self
Sets the value of attribution_token.
§Example
let x = SearchResponse::new().set_attribution_token("example");Sourcepub fn set_redirect_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_redirect_uri<T: Into<String>>(self, v: T) -> Self
Sets the value of redirect_uri.
§Example
let x = SearchResponse::new().set_redirect_uri("example");Sourcepub fn set_next_page_token<T: Into<String>>(self, v: T) -> Self
pub fn set_next_page_token<T: Into<String>>(self, v: T) -> Self
Sets the value of next_page_token.
§Example
let x = SearchResponse::new().set_next_page_token("example");Sourcepub fn set_corrected_query<T: Into<String>>(self, v: T) -> Self
pub fn set_corrected_query<T: Into<String>>(self, v: T) -> Self
Sets the value of corrected_query.
§Example
let x = SearchResponse::new().set_corrected_query("example");Sourcepub fn set_summary<T>(self, v: T) -> Self
pub fn set_summary<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_summary<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_summary<T>(self, v: Option<T>) -> Self
Sourcepub fn set_query_expansion_info<T>(self, v: T) -> Selfwhere
T: Into<QueryExpansionInfo>,
pub fn set_query_expansion_info<T>(self, v: T) -> Selfwhere
T: Into<QueryExpansionInfo>,
Sets the value of query_expansion_info.
§Example
use google_cloud_discoveryengine_v1::model::search_response::QueryExpansionInfo;
let x = SearchResponse::new().set_query_expansion_info(QueryExpansionInfo::default()/* use setters */);Sourcepub fn set_or_clear_query_expansion_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryExpansionInfo>,
pub fn set_or_clear_query_expansion_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryExpansionInfo>,
Sets or clears the value of query_expansion_info.
§Example
use google_cloud_discoveryengine_v1::model::search_response::QueryExpansionInfo;
let x = SearchResponse::new().set_or_clear_query_expansion_info(Some(QueryExpansionInfo::default()/* use setters */));
let x = SearchResponse::new().set_or_clear_query_expansion_info(None::<QueryExpansionInfo>);Sourcepub fn set_natural_language_query_understanding_info<T>(self, v: T) -> Selfwhere
T: Into<NaturalLanguageQueryUnderstandingInfo>,
pub fn set_natural_language_query_understanding_info<T>(self, v: T) -> Selfwhere
T: Into<NaturalLanguageQueryUnderstandingInfo>,
Sets the value of natural_language_query_understanding_info.
§Example
use google_cloud_discoveryengine_v1::model::search_response::NaturalLanguageQueryUnderstandingInfo;
let x = SearchResponse::new().set_natural_language_query_understanding_info(NaturalLanguageQueryUnderstandingInfo::default()/* use setters */);Sourcepub fn set_or_clear_natural_language_query_understanding_info<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<NaturalLanguageQueryUnderstandingInfo>,
pub fn set_or_clear_natural_language_query_understanding_info<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<NaturalLanguageQueryUnderstandingInfo>,
Sets or clears the value of natural_language_query_understanding_info.
§Example
use google_cloud_discoveryengine_v1::model::search_response::NaturalLanguageQueryUnderstandingInfo;
let x = SearchResponse::new().set_or_clear_natural_language_query_understanding_info(Some(NaturalLanguageQueryUnderstandingInfo::default()/* use setters */));
let x = SearchResponse::new().set_or_clear_natural_language_query_understanding_info(None::<NaturalLanguageQueryUnderstandingInfo>);Sourcepub fn set_session_info<T>(self, v: T) -> Selfwhere
T: Into<SessionInfo>,
pub fn set_session_info<T>(self, v: T) -> Selfwhere
T: Into<SessionInfo>,
Sets the value of session_info.
§Example
use google_cloud_discoveryengine_v1::model::search_response::SessionInfo;
let x = SearchResponse::new().set_session_info(SessionInfo::default()/* use setters */);Sourcepub fn set_or_clear_session_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionInfo>,
pub fn set_or_clear_session_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionInfo>,
Sets or clears the value of session_info.
§Example
use google_cloud_discoveryengine_v1::model::search_response::SessionInfo;
let x = SearchResponse::new().set_or_clear_session_info(Some(SessionInfo::default()/* use setters */));
let x = SearchResponse::new().set_or_clear_session_info(None::<SessionInfo>);Sourcepub fn set_search_link_promotions<T, V>(self, v: T) -> Self
pub fn set_search_link_promotions<T, V>(self, v: T) -> Self
Sets the value of search_link_promotions.
§Example
use google_cloud_discoveryengine_v1::model::SearchLinkPromotion;
let x = SearchResponse::new()
.set_search_link_promotions([
SearchLinkPromotion::default()/* use setters */,
SearchLinkPromotion::default()/* use (different) setters */,
]);Sourcepub fn set_semantic_state<T: Into<SemanticState>>(self, v: T) -> Self
pub fn set_semantic_state<T: Into<SemanticState>>(self, v: T) -> Self
Sets the value of semantic_state.
§Example
use google_cloud_discoveryengine_v1::model::search_response::SemanticState;
let x0 = SearchResponse::new().set_semantic_state(SemanticState::Disabled);
let x1 = SearchResponse::new().set_semantic_state(SemanticState::Enabled);Trait Implementations§
Source§impl Clone for SearchResponse
impl Clone for SearchResponse
Source§fn clone(&self) -> SearchResponse
fn clone(&self) -> SearchResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchResponse
impl Debug for SearchResponse
Source§impl Default for SearchResponse
impl Default for SearchResponse
Source§fn default() -> SearchResponse
fn default() -> SearchResponse
Source§impl Message for SearchResponse
impl Message for SearchResponse
Source§impl PartialEq for SearchResponse
impl PartialEq for SearchResponse
impl StructuralPartialEq for SearchResponse
Auto Trait Implementations§
impl Freeze for SearchResponse
impl RefUnwindSafe for SearchResponse
impl Send for SearchResponse
impl Sync for SearchResponse
impl Unpin for SearchResponse
impl UnsafeUnpin for SearchResponse
impl UnwindSafe for SearchResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request