#[non_exhaustive]pub struct QueryExpansionSpec {
pub condition: Condition,
pub pin_unexpanded_results: bool,
/* private fields */
}Available on crate features
assistant-service or conversational-search-service or search-service or serving-config-service only.Expand description
Specification to determine under which conditions query expansion should occur.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.condition: ConditionThe condition under which query expansion should occur. Default to Condition.DISABLED.
pin_unexpanded_results: boolWhether to pin unexpanded results. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results.
Implementations§
Source§impl QueryExpansionSpec
impl QueryExpansionSpec
pub fn new() -> Self
Sourcepub fn set_condition<T: Into<Condition>>(self, v: T) -> Self
pub fn set_condition<T: Into<Condition>>(self, v: T) -> Self
Sourcepub fn set_pin_unexpanded_results<T: Into<bool>>(self, v: T) -> Self
pub fn set_pin_unexpanded_results<T: Into<bool>>(self, v: T) -> Self
Sets the value of pin_unexpanded_results.
§Example
ⓘ
let x = QueryExpansionSpec::new().set_pin_unexpanded_results(true);Trait Implementations§
Source§impl Clone for QueryExpansionSpec
impl Clone for QueryExpansionSpec
Source§fn clone(&self) -> QueryExpansionSpec
fn clone(&self) -> QueryExpansionSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryExpansionSpec
impl Debug for QueryExpansionSpec
Source§impl Default for QueryExpansionSpec
impl Default for QueryExpansionSpec
Source§fn default() -> QueryExpansionSpec
fn default() -> QueryExpansionSpec
Returns the “default value” for a type. Read more
Source§impl Message for QueryExpansionSpec
impl Message for QueryExpansionSpec
Source§impl PartialEq for QueryExpansionSpec
impl PartialEq for QueryExpansionSpec
impl StructuralPartialEq for QueryExpansionSpec
Auto Trait Implementations§
impl Freeze for QueryExpansionSpec
impl RefUnwindSafe for QueryExpansionSpec
impl Send for QueryExpansionSpec
impl Sync for QueryExpansionSpec
impl Unpin for QueryExpansionSpec
impl UnwindSafe for QueryExpansionSpec
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
Mutably borrows from an owned value. Read more