pub struct VectorJoinOperator { /* private fields */ }Expand description
Vector join operator for hybrid graph + vector queries.
Takes entities from the left input and finds similar entities on the right based on vector embeddings. This enables queries like:
MATCH (u:User)-[:LIKED]->(liked:Movie)
WITH avg(liked.embedding) AS taste
VECTOR JOIN (m:Movie) ON m.embedding
WHERE cosine_similarity(m.embedding, taste) > 0.7
RETURN m.title§Output Schema
Output columns: [left columns…, right_node: Node, score: Float64]
Implementations§
Source§impl VectorJoinOperator
impl VectorJoinOperator
Sourcepub fn with_static_query(
left: Box<dyn Operator>,
store: Arc<LpgStore>,
query_vector: Vec<f32>,
right_property: impl Into<String>,
k: usize,
metric: DistanceMetric,
) -> Self
pub fn with_static_query( left: Box<dyn Operator>, store: Arc<LpgStore>, query_vector: Vec<f32>, right_property: impl Into<String>, k: usize, metric: DistanceMetric, ) -> Self
Creates a vector join with a static query vector.
Use this when the query vector is known upfront (e.g., a parameter).
§Arguments
left- Left input operatorstore- LPG store for vector property lookupquery_vector- The query vector for similarity searchright_property- Property containing right-side embeddingsk- Number of nearest neighbors per left rowmetric- Distance metric
Sourcepub fn entity_to_entity(
left: Box<dyn Operator>,
store: Arc<LpgStore>,
left_node_column: usize,
left_property: impl Into<String>,
right_property: impl Into<String>,
k: usize,
metric: DistanceMetric,
) -> Self
pub fn entity_to_entity( left: Box<dyn Operator>, store: Arc<LpgStore>, left_node_column: usize, left_property: impl Into<String>, right_property: impl Into<String>, k: usize, metric: DistanceMetric, ) -> Self
Creates a vector join for entity-to-entity similarity.
For each entity on the left, fetches its embedding and finds similar entities on the right.
§Arguments
left- Left input operatorstore- LPG store for property lookupleft_node_column- Column index containing NodeId in left inputleft_property- Property containing left-side embeddingsright_property- Property containing right-side embeddingsk- Number of nearest neighbors per left entitymetric- Distance metric
Sourcepub fn with_right_label(self, label: impl Into<String>) -> Self
pub fn with_right_label(self, label: impl Into<String>) -> Self
Sets a label filter for right-side entities.
Sourcepub fn with_min_similarity(self, threshold: f32) -> Self
pub fn with_min_similarity(self, threshold: f32) -> Self
Sets minimum similarity threshold (cosine metric only).
Sourcepub fn with_max_distance(self, threshold: f32) -> Self
pub fn with_max_distance(self, threshold: f32) -> Self
Sets maximum distance threshold.
Sourcepub fn with_chunk_capacity(self, capacity: usize) -> Self
pub fn with_chunk_capacity(self, capacity: usize) -> Self
Sets the output chunk capacity.
Trait Implementations§
Source§impl Operator for VectorJoinOperator
impl Operator for VectorJoinOperator
Auto Trait Implementations§
impl Freeze for VectorJoinOperator
impl !RefUnwindSafe for VectorJoinOperator
impl Send for VectorJoinOperator
impl Sync for VectorJoinOperator
impl Unpin for VectorJoinOperator
impl !UnwindSafe for VectorJoinOperator
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more