#[non_exhaustive]pub struct CompleteQueryResponse {
pub completion_results: Vec<CompletionResult>,
pub attribution_token: String,
pub recent_search_results: Vec<RecentSearchResult>,
pub attribute_results: HashMap<String, AttributeResult>,
/* private fields */
}Expand description
Response of the autocomplete query.
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.completion_results: Vec<CompletionResult>Results of the matching suggestions. The result list is ordered and the first result is top suggestion.
attribution_token: StringA unique complete token. This should be included in the UserEvent.completion_detail for search events resulting from this completion, which enables accurate attribution of complete model performance.
recent_search_results: Vec<RecentSearchResult>Deprecated. Matched recent searches of this user. The maximum number of recent searches is 10. This field is a restricted feature. If you want to enable it, contact Retail Search support.
This feature is only available when CompleteQueryRequest.visitor_id field is set and UserEvent is imported. The recent searches satisfy the follow rules:
-
They are ordered from latest to oldest.
-
They are matched with CompleteQueryRequest.query case insensitively.
-
They are transformed to lower case.
-
They are UTF-8 safe.
Recent searches are deduplicated. More recent searches will be reserved when duplication happens.
attribute_results: HashMap<String, AttributeResult>A map of matched attribute suggestions. This field is only available for
cloud-retail dataset.
Current supported keys:
-
brands -
categories
Implementations§
Source§impl CompleteQueryResponse
impl CompleteQueryResponse
pub fn new() -> Self
Sourcepub fn set_completion_results<T, V>(self, v: T) -> Self
pub fn set_completion_results<T, V>(self, v: T) -> Self
Sets the value of completion_results.
§Example
use google_cloud_retail_v2::model::complete_query_response::CompletionResult;
let x = CompleteQueryResponse::new()
.set_completion_results([
CompletionResult::default()/* use setters */,
CompletionResult::default()/* use (different) setters */,
]);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 = CompleteQueryResponse::new().set_attribution_token("example");Sourcepub fn set_recent_search_results<T, V>(self, v: T) -> Self
👎Deprecated
pub fn set_recent_search_results<T, V>(self, v: T) -> Self
Sets the value of recent_search_results.
§Example
use google_cloud_retail_v2::model::complete_query_response::RecentSearchResult;
let x = CompleteQueryResponse::new()
.set_recent_search_results([
RecentSearchResult::default()/* use setters */,
RecentSearchResult::default()/* use (different) setters */,
]);Sourcepub fn set_attribute_results<T, K, V>(self, v: T) -> Self
pub fn set_attribute_results<T, K, V>(self, v: T) -> Self
Sets the value of attribute_results.
§Example
use google_cloud_retail_v2::model::complete_query_response::AttributeResult;
let x = CompleteQueryResponse::new().set_attribute_results([
("key0", AttributeResult::default()/* use setters */),
("key1", AttributeResult::default()/* use (different) setters */),
]);Trait Implementations§
Source§impl Clone for CompleteQueryResponse
impl Clone for CompleteQueryResponse
Source§fn clone(&self) -> CompleteQueryResponse
fn clone(&self) -> CompleteQueryResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more