Struct google_api_proto::google::cloud::discoveryengine::v1::search_request::boost_spec::ConditionBoostSpec
source · pub struct ConditionBoostSpec {
pub condition: String,
pub boost: f32,
}
Expand description
Boost applies to documents which match a condition.
Fields§
§condition: String
An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See [SearchRequest.filter][google.cloud.discoveryengine.v1.SearchRequest.filter] for detail syntax and limitations.
Examples:
- To boost documents with document ID “doc_1” or “doc_2”, and
color “Red” or “Blue”:
(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))
boost: f32
Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0.
Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents.
Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely.
Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
Trait Implementations§
source§impl Clone for ConditionBoostSpec
impl Clone for ConditionBoostSpec
source§fn clone(&self) -> ConditionBoostSpec
fn clone(&self) -> ConditionBoostSpec
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConditionBoostSpec
impl Debug for ConditionBoostSpec
source§impl Default for ConditionBoostSpec
impl Default for ConditionBoostSpec
source§impl Message for ConditionBoostSpec
impl Message for ConditionBoostSpec
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for ConditionBoostSpec
impl PartialEq for ConditionBoostSpec
source§fn eq(&self, other: &ConditionBoostSpec) -> bool
fn eq(&self, other: &ConditionBoostSpec) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ConditionBoostSpec
Auto Trait Implementations§
impl Freeze for ConditionBoostSpec
impl RefUnwindSafe for ConditionBoostSpec
impl Send for ConditionBoostSpec
impl Sync for ConditionBoostSpec
impl Unpin for ConditionBoostSpec
impl UnwindSafe for ConditionBoostSpec
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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