Struct google_api_proto::google::cloud::discoveryengine::v1::search_request::facet_spec::FacetKey
source · pub struct FacetKey {
pub key: String,
pub intervals: Vec<Interval>,
pub restricted_values: Vec<String>,
pub prefixes: Vec<String>,
pub contains: Vec<String>,
pub case_insensitive: bool,
pub order_by: String,
}
Expand description
Specifies how a facet is computed.
Fields§
§key: String
Required. Supported textual and numerical facet keys in [Document][google.cloud.discoveryengine.v1.Document] object, over which the facet values are computed. Facet key is case-sensitive.
intervals: Vec<Interval>
Set only if values should be bucketed into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30.
restricted_values: Vec<String>
Only get facet for the given restricted values. Only supported on textual fields. For example, suppose “category” has three values “Action > 2022”, “Action > 2021” and “Sci-Fi > 2022”. If set “restricted_values” to “Action > 2022”, the “category” facet only contains “Action > 2022”. Only supported on textual fields. Maximum is 10.
prefixes: Vec<String>
Only get facet values that start with the given string prefix. For example, suppose “category” has three values “Action > 2022”, “Action > 2021” and “Sci-Fi > 2022”. If set “prefixes” to “Action”, the “category” facet only contains “Action > 2022” and “Action > 2021”. Only supported on textual fields. Maximum is 10.
contains: Vec<String>
Only get facet values that contain the given strings. For example, suppose “category” has three values “Action > 2022”, “Action > 2021” and “Sci-Fi > 2022”. If set “contains” to “2022”, the “category” facet only contains “Action > 2022” and “Sci-Fi > 2022”. Only supported on textual fields. Maximum is 10.
case_insensitive: bool
True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.
order_by: String
The order in which documents are returned.
Allowed values are:
-
“count desc”, which means order by [SearchResponse.Facet.values.count][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.count] descending.
-
“value desc”, which means order by [SearchResponse.Facet.values.value][google.cloud.discoveryengine.v1.SearchResponse.Facet.FacetValue.value] descending. Only applies to textual facets.
If not set, textual values are sorted in natural order; numerical intervals are sorted in the order given by [FacetSpec.FacetKey.intervals][google.cloud.discoveryengine.v1.SearchRequest.FacetSpec.FacetKey.intervals].
Trait Implementations§
source§impl Message for FacetKey
impl Message for FacetKey
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 FacetKey
impl PartialEq for FacetKey
impl StructuralPartialEq for FacetKey
Auto Trait Implementations§
impl Freeze for FacetKey
impl RefUnwindSafe for FacetKey
impl Send for FacetKey
impl Sync for FacetKey
impl Unpin for FacetKey
impl UnwindSafe for FacetKey
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