pub struct RuVectorIndex { /* private fields */ }Expand description
Main RuVector index combining HNSW, GNN, and Graph capabilities
Implementations§
Source§impl RuVectorIndex
impl RuVectorIndex
Sourcepub fn new(config: RuVectorConfig) -> Self
pub fn new(config: RuVectorConfig) -> Self
Create new RuVector index
Sourcepub fn insert(&mut self, entry: VectorEntry) -> Result<()>
pub fn insert(&mut self, entry: VectorEntry) -> Result<()>
Insert a vector
Sourcepub fn search(&self, query: &[f32], k: usize) -> Result<Vec<RuVectorResult>>
pub fn search(&self, query: &[f32], k: usize) -> Result<Vec<RuVectorResult>>
Search for similar vectors
Sourcepub fn search_gnn(&self, query: &[f32], k: usize) -> Result<Vec<RuVectorResult>>
pub fn search_gnn(&self, query: &[f32], k: usize) -> Result<Vec<RuVectorResult>>
Search with GNN-enhanced ranking
Sourcepub fn graph_query(&self, query: &str) -> Result<Vec<GraphQueryResult>>
pub fn graph_query(&self, query: &str) -> Result<Vec<GraphQueryResult>>
Execute a Cypher-like graph query
Sourcepub fn add_relationship(
&mut self,
source: &str,
target: &str,
relationship: &str,
weight: f64,
properties: Value,
) -> Result<()>
pub fn add_relationship( &mut self, source: &str, target: &str, relationship: &str, weight: f64, properties: Value, ) -> Result<()>
Add a graph relationship
Sourcepub fn learn(&mut self, query: &[f32], relevant_ids: &[String]) -> Result<()>
pub fn learn(&mut self, query: &[f32], relevant_ids: &[String]) -> Result<()>
Learn from feedback (GNN training)
Sourcepub fn get(&self, id: &str) -> Option<&VectorEntry>
pub fn get(&self, id: &str) -> Option<&VectorEntry>
Get vector by ID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuVectorIndex
impl RefUnwindSafe for RuVectorIndex
impl Send for RuVectorIndex
impl Sync for RuVectorIndex
impl Unpin for RuVectorIndex
impl UnwindSafe for RuVectorIndex
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