#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompleteQueryResponse
impl Debug for CompleteQueryResponse
Source§impl Default for CompleteQueryResponse
impl Default for CompleteQueryResponse
Source§fn default() -> CompleteQueryResponse
fn default() -> CompleteQueryResponse
Source§impl Message for CompleteQueryResponse
impl Message for CompleteQueryResponse
Source§impl PartialEq for CompleteQueryResponse
impl PartialEq for CompleteQueryResponse
impl StructuralPartialEq for CompleteQueryResponse
Auto Trait Implementations§
impl Freeze for CompleteQueryResponse
impl RefUnwindSafe for CompleteQueryResponse
impl Send for CompleteQueryResponse
impl Sync for CompleteQueryResponse
impl Unpin for CompleteQueryResponse
impl UnsafeUnpin for CompleteQueryResponse
impl UnwindSafe for CompleteQueryResponse
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