#[non_exhaustive]pub struct SearchResponse {
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 session_info: Option<SessionInfo>,
pub search_link_promotions: Vec<SearchLinkPromotion>,
/* private fields */
}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.
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.
Implementations§
Source§impl SearchResponse
impl SearchResponse
pub fn new() -> Self
Sourcepub fn set_results<T, V>(self, v: T) -> Self
pub fn set_results<T, V>(self, v: T) -> Self
Sets the value of results.
Sourcepub fn set_facets<T, V>(self, v: T) -> Self
pub fn set_facets<T, V>(self, v: T) -> Self
Sets the value of facets.
Sourcepub fn set_total_size<T: Into<i32>>(self, v: T) -> Self
pub fn set_total_size<T: Into<i32>>(self, v: T) -> Self
Sets the value of total_size.
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.
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.
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.
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.
Sourcepub fn set_summary<T>(self, v: T) -> Self
pub fn set_summary<T>(self, v: T) -> Self
Sets the value of summary.
Sourcepub fn set_or_clear_summary<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_summary<T>(self, v: Option<T>) -> Self
Sets or clears the value of summary.
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.
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.
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.
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.
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.
Trait Implementations§
Source§impl Clone for SearchResponse
impl Clone for SearchResponse
Source§fn clone(&self) -> SearchResponse
fn clone(&self) -> SearchResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more