#[non_exhaustive]pub struct IndexDatapoint {
pub datapoint_id: String,
pub feature_vector: Vec<f32>,
pub sparse_embedding: Option<SparseEmbedding>,
pub restricts: Vec<Restriction>,
pub numeric_restricts: Vec<NumericRestriction>,
pub crowding_tag: Option<CrowdingTag>,
pub embedding_metadata: Option<Struct>,
/* private fields */
}index-service or match-service only.Expand description
A datapoint of Index.
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.datapoint_id: StringRequired. Unique identifier of the datapoint.
feature_vector: Vec<f32>Required. Feature embedding vector for dense index. An array of numbers with the length of [NearestNeighborSearchConfig.dimensions].
sparse_embedding: Option<SparseEmbedding>Optional. Feature embedding vector for sparse index.
restricts: Vec<Restriction>Optional. List of Restrict of the datapoint, used to perform “restricted searches” where boolean rule are used to filter the subset of the database eligible for matching. This uses categorical tokens. See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering
numeric_restricts: Vec<NumericRestriction>Optional. List of Restrict of the datapoint, used to perform “restricted searches” where boolean rule are used to filter the subset of the database eligible for matching. This uses numeric comparisons.
crowding_tag: Option<CrowdingTag>Optional. CrowdingTag of the datapoint, the number of neighbors to return in each crowding can be configured during query.
embedding_metadata: Option<Struct>Optional. The key-value map of additional metadata for the datapoint.
Implementations§
Source§impl IndexDatapoint
impl IndexDatapoint
pub fn new() -> Self
Sourcepub fn set_datapoint_id<T: Into<String>>(self, v: T) -> Self
pub fn set_datapoint_id<T: Into<String>>(self, v: T) -> Self
Sets the value of datapoint_id.
§Example
let x = IndexDatapoint::new().set_datapoint_id("example");Sourcepub fn set_feature_vector<T, V>(self, v: T) -> Self
pub fn set_feature_vector<T, V>(self, v: T) -> Self
Sets the value of feature_vector.
§Example
let x = IndexDatapoint::new().set_feature_vector([1.0, 2.0, 3.0]);Sourcepub fn set_sparse_embedding<T>(self, v: T) -> Selfwhere
T: Into<SparseEmbedding>,
pub fn set_sparse_embedding<T>(self, v: T) -> Selfwhere
T: Into<SparseEmbedding>,
Sets the value of sparse_embedding.
§Example
use google_cloud_aiplatform_v1::model::index_datapoint::SparseEmbedding;
let x = IndexDatapoint::new().set_sparse_embedding(SparseEmbedding::default()/* use setters */);Sourcepub fn set_or_clear_sparse_embedding<T>(self, v: Option<T>) -> Selfwhere
T: Into<SparseEmbedding>,
pub fn set_or_clear_sparse_embedding<T>(self, v: Option<T>) -> Selfwhere
T: Into<SparseEmbedding>,
Sets or clears the value of sparse_embedding.
§Example
use google_cloud_aiplatform_v1::model::index_datapoint::SparseEmbedding;
let x = IndexDatapoint::new().set_or_clear_sparse_embedding(Some(SparseEmbedding::default()/* use setters */));
let x = IndexDatapoint::new().set_or_clear_sparse_embedding(None::<SparseEmbedding>);Sourcepub fn set_restricts<T, V>(self, v: T) -> Self
pub fn set_restricts<T, V>(self, v: T) -> Self
Sourcepub fn set_numeric_restricts<T, V>(self, v: T) -> Self
pub fn set_numeric_restricts<T, V>(self, v: T) -> Self
Sets the value of numeric_restricts.
§Example
use google_cloud_aiplatform_v1::model::index_datapoint::NumericRestriction;
let x = IndexDatapoint::new()
.set_numeric_restricts([
NumericRestriction::default()/* use setters */,
NumericRestriction::default()/* use (different) setters */,
]);Sourcepub fn set_crowding_tag<T>(self, v: T) -> Selfwhere
T: Into<CrowdingTag>,
pub fn set_crowding_tag<T>(self, v: T) -> Selfwhere
T: Into<CrowdingTag>,
Sets the value of crowding_tag.
§Example
use google_cloud_aiplatform_v1::model::index_datapoint::CrowdingTag;
let x = IndexDatapoint::new().set_crowding_tag(CrowdingTag::default()/* use setters */);Sourcepub fn set_or_clear_crowding_tag<T>(self, v: Option<T>) -> Selfwhere
T: Into<CrowdingTag>,
pub fn set_or_clear_crowding_tag<T>(self, v: Option<T>) -> Selfwhere
T: Into<CrowdingTag>,
Sets or clears the value of crowding_tag.
§Example
use google_cloud_aiplatform_v1::model::index_datapoint::CrowdingTag;
let x = IndexDatapoint::new().set_or_clear_crowding_tag(Some(CrowdingTag::default()/* use setters */));
let x = IndexDatapoint::new().set_or_clear_crowding_tag(None::<CrowdingTag>);Sourcepub fn set_embedding_metadata<T>(self, v: T) -> Self
pub fn set_embedding_metadata<T>(self, v: T) -> Self
Sets the value of embedding_metadata.
§Example
use wkt::Struct;
let x = IndexDatapoint::new().set_embedding_metadata(Struct::default()/* use setters */);Sourcepub fn set_or_clear_embedding_metadata<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_embedding_metadata<T>(self, v: Option<T>) -> Self
Sets or clears the value of embedding_metadata.
§Example
use wkt::Struct;
let x = IndexDatapoint::new().set_or_clear_embedding_metadata(Some(Struct::default()/* use setters */));
let x = IndexDatapoint::new().set_or_clear_embedding_metadata(None::<Struct>);Trait Implementations§
Source§impl Clone for IndexDatapoint
impl Clone for IndexDatapoint
Source§fn clone(&self) -> IndexDatapoint
fn clone(&self) -> IndexDatapoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more