#[non_exhaustive]pub struct NearestNeighborQuery {
pub neighbor_count: i32,
pub string_filters: Vec<StringFilter>,
pub numeric_filters: Vec<NumericFilter>,
pub per_crowding_attribute_neighbor_count: i32,
pub parameters: Option<Parameters>,
pub instance: Option<Instance>,
/* private fields */
}Expand description
A query to find a number of similar entities.
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.neighbor_count: i32Optional. The number of similar entities to be retrieved from feature view for each query.
string_filters: Vec<StringFilter>Optional. The list of string filters.
numeric_filters: Vec<NumericFilter>Optional. The list of numeric filters.
per_crowding_attribute_neighbor_count: i32Optional. Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than sper_crowding_attribute_neighbor_count of the k neighbors returned have the same value of crowding_attribute. It’s used for improving result diversity.
parameters: Option<Parameters>Optional. Parameters that can be set to tune query on the fly.
instance: Option<Instance>Implementations§
Source§impl NearestNeighborQuery
impl NearestNeighborQuery
pub fn new() -> Self
Sourcepub fn set_neighbor_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_neighbor_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of neighbor_count.
Sourcepub fn set_string_filters<T, V>(self, v: T) -> Self
pub fn set_string_filters<T, V>(self, v: T) -> Self
Sets the value of string_filters.
Sourcepub fn set_numeric_filters<T, V>(self, v: T) -> Self
pub fn set_numeric_filters<T, V>(self, v: T) -> Self
Sets the value of numeric_filters.
Sourcepub fn set_per_crowding_attribute_neighbor_count<T: Into<i32>>(
self,
v: T,
) -> Self
pub fn set_per_crowding_attribute_neighbor_count<T: Into<i32>>( self, v: T, ) -> Self
Sets the value of per_crowding_attribute_neighbor_count.
Sourcepub fn set_parameters<T: Into<Option<Parameters>>>(self, v: T) -> Self
pub fn set_parameters<T: Into<Option<Parameters>>>(self, v: T) -> Self
Sets the value of parameters.
Sourcepub fn set_instance<T: Into<Option<Instance>>>(self, v: T) -> Self
pub fn set_instance<T: Into<Option<Instance>>>(self, v: T) -> Self
Sets the value of instance.
Note that all the setters affecting instance are mutually
exclusive.
Sourcepub fn entity_id(&self) -> Option<&String>
pub fn entity_id(&self) -> Option<&String>
The value of instance
if it holds a EntityId, None if the field is not set or
holds a different branch.
Sourcepub fn set_entity_id<T: Into<String>>(self, v: T) -> Self
pub fn set_entity_id<T: Into<String>>(self, v: T) -> Self
Sets the value of instance
to hold a EntityId.
Note that all the setters affecting instance are
mutually exclusive.
Trait Implementations§
Source§impl Clone for NearestNeighborQuery
impl Clone for NearestNeighborQuery
Source§fn clone(&self) -> NearestNeighborQuery
fn clone(&self) -> NearestNeighborQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more