pub struct FieldConfig {
    pub field_path: String,
    pub field_type: i32,
    pub indexable_option: i32,
    pub dynamic_facetable_option: i32,
    pub searchable_option: i32,
    pub retrievable_option: i32,
    pub completable_option: i32,
    pub recs_filterable_option: i32,
    pub key_property_type: String,
    pub advanced_site_search_data_sources: Vec<i32>,
    pub schema_org_paths: Vec<String>,
}
Expand description

Configurations for fields of a schema. For example, configuring a field is indexable, or searchable.

Fields§

§field_path: String

Required. Field path of the schema field. For example: title, description, release_info.release_year.

§field_type: i32

Output only. Raw type of the field.

§indexable_option: i32

If [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] is [INDEXABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_ENABLED], field values are indexed so that it can be filtered or faceted in [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].

If [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] is unset, the server behavior defaults to [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED] for fields that support setting indexable options. For those fields that do not support setting indexable options, such as object and boolean and key properties, the server will skip [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] setting, and setting [indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] for those fields will throw INVALID_ARGUMENT error.

§dynamic_facetable_option: i32

If [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] is [DYNAMIC_FACETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_ENABLED], field values are available for dynamic facet. Could only be [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED] if [FieldConfig.indexable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.indexable_option] is [INDEXABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.IndexableOption.INDEXABLE_DISABLED]. Otherwise, an INVALID_ARGUMENT error will be returned.

If [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] is unset, the server behavior defaults to [DYNAMIC_FACETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.DynamicFacetableOption.DYNAMIC_FACETABLE_DISABLED] for fields that support setting dynamic facetable options. For those fields that do not support setting dynamic facetable options, such as object and boolean, the server will skip dynamic facetable option setting, and setting [dynamic_facetable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.dynamic_facetable_option] for those fields will throw INVALID_ARGUMENT error.

§searchable_option: i32

If [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] is [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED], field values are searchable by text queries in [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search].

If [SEARCHABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_ENABLED] but field type is numerical, field values will not be searchable by text queries in [SearchService.Search][google.cloud.discoveryengine.v1alpha.SearchService.Search], as there are no text values associated to numerical fields.

If [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] is unset, the server behavior defaults to [SEARCHABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.SearchableOption.SEARCHABLE_DISABLED] for fields that support setting searchable options. Only string fields that have no key property mapping support setting [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option].

For those fields that do not support setting searchable options, the server will skip searchable option setting, and setting [searchable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.searchable_option] for those fields will throw INVALID_ARGUMENT error.

§retrievable_option: i32

If [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] is [RETRIEVABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_ENABLED], field values are included in the search results.

If [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] is unset, the server behavior defaults to [RETRIEVABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.RetrievableOption.RETRIEVABLE_DISABLED] for fields that support setting retrievable options. For those fields that do not support setting retrievable options, such as object and boolean, the server will skip retrievable option setting, and setting [retrievable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.retrievable_option] for those fields will throw INVALID_ARGUMENT error.

§completable_option: i32

If [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] is [COMPLETABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_ENABLED], field values are directly used and returned as suggestions for Autocomplete in [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1alpha.CompletionService.CompleteQuery].

If [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] is unset, the server behavior defaults to [COMPLETABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.CompletableOption.COMPLETABLE_DISABLED] for fields that support setting completable options, which are just string fields. For those fields that do not support setting completable options, the server will skip completable option setting, and setting [completable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.completable_option] for those fields will throw INVALID_ARGUMENT error.

§recs_filterable_option: i32

If [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option] is [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED], field values are filterable by filter expression in [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend].

If [FILTERABLE_ENABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_ENABLED] but the field type is numerical, field values are not filterable by text queries in [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]. Only textual fields are supported.

If [recs_filterable_option][google.cloud.discoveryengine.v1alpha.FieldConfig.recs_filterable_option] is unset, the default setting is [FILTERABLE_DISABLED][google.cloud.discoveryengine.v1alpha.FieldConfig.FilterableOption.FILTERABLE_DISABLED] for fields that support setting filterable options.

When a field set to [FILTERABLE_DISABLED] is filtered, a warning is generated and an empty result is returned.

§key_property_type: String

Output only. Type of the key property that this field is mapped to. Empty string if this is not annotated as mapped to a key property.

Example types are title, description. Full list is defined by keyPropertyMapping in the schema field annotation.

If the schema field has a KeyPropertyMapping annotation, indexable_option and searchable_option of this field cannot be modified.

§advanced_site_search_data_sources: Vec<i32>

If this field is set, only the corresponding source will be indexed for this field. Otherwise, the values from different sources are merged.

Assuming a page with <author, a> in meta tag, and <author, b> in page map: if this enum is set to METATAGS, we will only index <author, a>; if this enum is not set, we will merge them and index <author, \[a, b\]>.

§schema_org_paths: Vec<String>

Field paths for indexing custom attribute from schema.org data. More details of schema.org and its defined types can be found at schema.org.

It is only used on advanced site search schema.

Currently only support full path from root. The full path to a field is constructed by concatenating field names, starting from _root, with a period . as the delimiter. Examples:

  • Publish date of the root: _root.datePublished
  • Publish date of the reviews: _root.review.datePublished

Implementations§

source§

impl FieldConfig

source

pub fn field_type(&self) -> FieldType

Returns the enum value of field_type, or the default if the field is set to an invalid enum value.

source

pub fn set_field_type(&mut self, value: FieldType)

Sets field_type to the provided enum value.

source

pub fn indexable_option(&self) -> IndexableOption

Returns the enum value of indexable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_indexable_option(&mut self, value: IndexableOption)

Sets indexable_option to the provided enum value.

source

pub fn dynamic_facetable_option(&self) -> DynamicFacetableOption

Returns the enum value of dynamic_facetable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_dynamic_facetable_option(&mut self, value: DynamicFacetableOption)

Sets dynamic_facetable_option to the provided enum value.

source

pub fn searchable_option(&self) -> SearchableOption

Returns the enum value of searchable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_searchable_option(&mut self, value: SearchableOption)

Sets searchable_option to the provided enum value.

source

pub fn retrievable_option(&self) -> RetrievableOption

Returns the enum value of retrievable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_retrievable_option(&mut self, value: RetrievableOption)

Sets retrievable_option to the provided enum value.

source

pub fn completable_option(&self) -> CompletableOption

Returns the enum value of completable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_completable_option(&mut self, value: CompletableOption)

Sets completable_option to the provided enum value.

source

pub fn recs_filterable_option(&self) -> FilterableOption

Returns the enum value of recs_filterable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_recs_filterable_option(&mut self, value: FilterableOption)

Sets recs_filterable_option to the provided enum value.

source

pub fn advanced_site_search_data_sources( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<AdvancedSiteSearchDataSource>>

Returns an iterator which yields the valid enum values contained in advanced_site_search_data_sources.

source

pub fn push_advanced_site_search_data_sources( &mut self, value: AdvancedSiteSearchDataSource, )

Appends the provided enum value to advanced_site_search_data_sources.

Trait Implementations§

source§

impl Clone for FieldConfig

source§

fn clone(&self) -> FieldConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FieldConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FieldConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for FieldConfig

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for FieldConfig

source§

fn eq(&self, other: &FieldConfig) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for FieldConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more