#[non_exhaustive]pub struct BoostAction {
pub boost: f32,
pub filter: String,
pub data_store: String,
pub boost_spec: Option<BoostSpec>,
/* private fields */
}control-service only.Expand description
Adjusts order of products in returned list.
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.boost: f32Strength of the boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0 (No-op).
filter: StringRequired. Specifies which products to apply the boost to.
If no filter is provided all products will be boosted (No-op). Syntax documentation: https://cloud.google.com/retail/docs/filter-and-order Maximum length is 5000 characters. Otherwise an INVALID ARGUMENT error is thrown.
data_store: StringRequired. Specifies which data store’s documents can be boosted by this control. Full data store name e.g. projects/123/locations/global/collections/default_collection/dataStores/default_data_store
boost_spec: Option<BoostSpec>Constant value boost or custom ranking based boost specifications.
Implementations§
Source§impl BoostAction
impl BoostAction
pub fn new() -> Self
Sourcepub fn set_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_filter<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_data_store<T: Into<String>>(self, v: T) -> Self
pub fn set_data_store<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_boost_spec<T: Into<Option<BoostSpec>>>(self, v: T) -> Self
pub fn set_boost_spec<T: Into<Option<BoostSpec>>>(self, v: T) -> Self
Sets the value of boost_spec.
Note that all the setters affecting boost_spec are mutually
exclusive.
§Example
use google_cloud_discoveryengine_v1::model::control::boost_action::BoostSpec;
let x = BoostAction::new().set_boost_spec(Some(BoostSpec::FixedBoost(42.0)));Sourcepub fn fixed_boost(&self) -> Option<&f32>
pub fn fixed_boost(&self) -> Option<&f32>
The value of boost_spec
if it holds a FixedBoost, None if the field is not set or
holds a different branch.
Sourcepub fn set_fixed_boost<T: Into<f32>>(self, v: T) -> Self
pub fn set_fixed_boost<T: Into<f32>>(self, v: T) -> Self
Sets the value of boost_spec
to hold a FixedBoost.
Note that all the setters affecting boost_spec are
mutually exclusive.
§Example
let x = BoostAction::new().set_fixed_boost(42.0);
assert!(x.fixed_boost().is_some());
assert!(x.interpolation_boost_spec().is_none());Sourcepub fn interpolation_boost_spec(&self) -> Option<&Box<InterpolationBoostSpec>>
pub fn interpolation_boost_spec(&self) -> Option<&Box<InterpolationBoostSpec>>
The value of boost_spec
if it holds a InterpolationBoostSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_interpolation_boost_spec<T: Into<Box<InterpolationBoostSpec>>>(
self,
v: T,
) -> Self
pub fn set_interpolation_boost_spec<T: Into<Box<InterpolationBoostSpec>>>( self, v: T, ) -> Self
Sets the value of boost_spec
to hold a InterpolationBoostSpec.
Note that all the setters affecting boost_spec are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::control::boost_action::InterpolationBoostSpec;
let x = BoostAction::new().set_interpolation_boost_spec(InterpolationBoostSpec::default()/* use setters */);
assert!(x.interpolation_boost_spec().is_some());
assert!(x.fixed_boost().is_none());Trait Implementations§
Source§impl Clone for BoostAction
impl Clone for BoostAction
Source§fn clone(&self) -> BoostAction
fn clone(&self) -> BoostAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more