#[non_exhaustive]pub struct SearchResponse {Show 14 fields
pub results: Vec<SearchResult>,
pub facets: Vec<Facet>,
pub total_size: i32,
pub corrected_query: String,
pub attribution_token: String,
pub next_page_token: String,
pub query_expansion_info: Option<QueryExpansionInfo>,
pub redirect_uri: String,
pub applied_controls: Vec<String>,
pub pin_control_metadata: Option<PinControlMetadata>,
pub invalid_condition_boost_specs: Vec<ConditionBoostSpec>,
pub experiment_info: Vec<ExperimentInfo>,
pub conversational_search_result: Option<ConversationalSearchResult>,
pub tile_navigation_result: Option<TileNavigationResult>,
/* 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 items. 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.
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.
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.
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.
query_expansion_info: Option<QueryExpansionInfo>Query expansion information for the returned results.
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.
applied_controls: Vec<String>The fully qualified resource name of applied controls.
pin_control_metadata: Option<PinControlMetadata>Metadata for pin controls which were applicable to the request. This contains two map fields, one for all matched pins and one for pins which were matched but not applied.
The two maps are keyed by pin position, and the values are the product ids which were matched to that pin.
invalid_condition_boost_specs: Vec<ConditionBoostSpec>The invalid SearchRequest.BoostSpec.condition_boost_specs that are not applied during serving.
experiment_info: Vec<ExperimentInfo>Metadata related to A/B testing experiment associated with this response. Only exists when an experiment is triggered.
conversational_search_result: Option<ConversationalSearchResult>This field specifies all related information that is needed on client side for UI rendering of conversational retail search.
This field specifies all related information for tile navigation that will be used in client side.
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
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_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_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_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_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_retail_v2::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_retail_v2::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_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_applied_controls<T, V>(self, v: T) -> Self
pub fn set_applied_controls<T, V>(self, v: T) -> Self
Sets the value of applied_controls.
§Example
let x = SearchResponse::new().set_applied_controls(["a", "b", "c"]);Sourcepub fn set_pin_control_metadata<T>(self, v: T) -> Selfwhere
T: Into<PinControlMetadata>,
pub fn set_pin_control_metadata<T>(self, v: T) -> Selfwhere
T: Into<PinControlMetadata>,
Sets the value of pin_control_metadata.
§Example
use google_cloud_retail_v2::model::PinControlMetadata;
let x = SearchResponse::new().set_pin_control_metadata(PinControlMetadata::default()/* use setters */);Sourcepub fn set_or_clear_pin_control_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<PinControlMetadata>,
pub fn set_or_clear_pin_control_metadata<T>(self, v: Option<T>) -> Selfwhere
T: Into<PinControlMetadata>,
Sets or clears the value of pin_control_metadata.
§Example
use google_cloud_retail_v2::model::PinControlMetadata;
let x = SearchResponse::new().set_or_clear_pin_control_metadata(Some(PinControlMetadata::default()/* use setters */));
let x = SearchResponse::new().set_or_clear_pin_control_metadata(None::<PinControlMetadata>);Sourcepub fn set_invalid_condition_boost_specs<T, V>(self, v: T) -> Self
pub fn set_invalid_condition_boost_specs<T, V>(self, v: T) -> Self
Sets the value of invalid_condition_boost_specs.
§Example
use google_cloud_retail_v2::model::search_request::boost_spec::ConditionBoostSpec;
let x = SearchResponse::new()
.set_invalid_condition_boost_specs([
ConditionBoostSpec::default()/* use setters */,
ConditionBoostSpec::default()/* use (different) setters */,
]);Sourcepub fn set_experiment_info<T, V>(self, v: T) -> Self
pub fn set_experiment_info<T, V>(self, v: T) -> Self
Sets the value of experiment_info.
§Example
use google_cloud_retail_v2::model::ExperimentInfo;
let x = SearchResponse::new()
.set_experiment_info([
ExperimentInfo::default()/* use setters */,
ExperimentInfo::default()/* use (different) setters */,
]);Sourcepub fn set_conversational_search_result<T>(self, v: T) -> Selfwhere
T: Into<ConversationalSearchResult>,
pub fn set_conversational_search_result<T>(self, v: T) -> Selfwhere
T: Into<ConversationalSearchResult>,
Sets the value of conversational_search_result.
§Example
use google_cloud_retail_v2::model::search_response::ConversationalSearchResult;
let x = SearchResponse::new().set_conversational_search_result(ConversationalSearchResult::default()/* use setters */);Sourcepub fn set_or_clear_conversational_search_result<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConversationalSearchResult>,
pub fn set_or_clear_conversational_search_result<T>(self, v: Option<T>) -> Selfwhere
T: Into<ConversationalSearchResult>,
Sets or clears the value of conversational_search_result.
§Example
use google_cloud_retail_v2::model::search_response::ConversationalSearchResult;
let x = SearchResponse::new().set_or_clear_conversational_search_result(Some(ConversationalSearchResult::default()/* use setters */));
let x = SearchResponse::new().set_or_clear_conversational_search_result(None::<ConversationalSearchResult>);Sets the value of tile_navigation_result.
§Example
use google_cloud_retail_v2::model::search_response::TileNavigationResult;
let x = SearchResponse::new().set_tile_navigation_result(TileNavigationResult::default()/* use setters */);Sets or clears the value of tile_navigation_result.
§Example
use google_cloud_retail_v2::model::search_response::TileNavigationResult;
let x = SearchResponse::new().set_or_clear_tile_navigation_result(Some(TileNavigationResult::default()/* use setters */));
let x = SearchResponse::new().set_or_clear_tile_navigation_result(None::<TileNavigationResult>);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