Skip to main content

VectorJoinOperator

Struct VectorJoinOperator 

Source
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

Source

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 operator
  • store - LPG store for vector property lookup
  • query_vector - The query vector for similarity search
  • right_property - Property containing right-side embeddings
  • k - Number of nearest neighbors per left row
  • metric - Distance metric
Source

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 operator
  • store - LPG store for property lookup
  • left_node_column - Column index containing NodeId in left input
  • left_property - Property containing left-side embeddings
  • right_property - Property containing right-side embeddings
  • k - Number of nearest neighbors per left entity
  • metric - Distance metric
Source

pub fn with_right_label(self, label: impl Into<String>) -> Self

Sets a label filter for right-side entities.

Source

pub fn with_min_similarity(self, threshold: f32) -> Self

Sets minimum similarity threshold (cosine metric only).

Source

pub fn with_max_distance(self, threshold: f32) -> Self

Sets maximum distance threshold.

Source

pub fn with_ef(self, ef: usize) -> Self

Sets the HNSW search ef parameter.

Source

pub fn with_chunk_capacity(self, capacity: usize) -> Self

Sets the output chunk capacity.

Trait Implementations§

Source§

impl Operator for VectorJoinOperator

Source§

fn next(&mut self) -> OperatorResult

Pulls the next batch of data. Returns None when exhausted.
Source§

fn reset(&mut self)

Resets to initial state so you can iterate again.
Source§

fn name(&self) -> &'static str

Returns a name for debugging/explain output.

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.

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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>,

Source§

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.