pub struct HybridIndex { /* private fields */ }Expand description
Hybrid index combining graph structure with vector search
Implementations§
Source§impl HybridIndex
impl HybridIndex
Sourcepub fn new(config: EmbeddingConfig) -> Result<Self>
pub fn new(config: EmbeddingConfig) -> Result<Self>
Create a new hybrid index
Sourcepub fn initialize_index(&self, index_type: VectorIndexType) -> Result<()>
pub fn initialize_index(&self, index_type: VectorIndexType) -> Result<()>
Initialize index for a specific element type
Sourcepub fn add_node_embedding(
&self,
node_id: NodeId,
embedding: Vec<f32>,
) -> Result<()>
pub fn add_node_embedding( &self, node_id: NodeId, embedding: Vec<f32>, ) -> Result<()>
Add node embedding to index
Sourcepub fn add_edge_embedding(
&self,
edge_id: EdgeId,
embedding: Vec<f32>,
) -> Result<()>
pub fn add_edge_embedding( &self, edge_id: EdgeId, embedding: Vec<f32>, ) -> Result<()>
Add edge embedding to index
Sourcepub fn add_hyperedge_embedding(
&self,
hyperedge_id: String,
embedding: Vec<f32>,
) -> Result<()>
pub fn add_hyperedge_embedding( &self, hyperedge_id: String, embedding: Vec<f32>, ) -> Result<()>
Add hyperedge embedding to index
Sourcepub fn search_similar_nodes(
&self,
query: &[f32],
k: usize,
) -> Result<Vec<(NodeId, f32)>>
pub fn search_similar_nodes( &self, query: &[f32], k: usize, ) -> Result<Vec<(NodeId, f32)>>
Search for similar nodes
Sourcepub fn search_similar_edges(
&self,
query: &[f32],
k: usize,
) -> Result<Vec<(EdgeId, f32)>>
pub fn search_similar_edges( &self, query: &[f32], k: usize, ) -> Result<Vec<(EdgeId, f32)>>
Search for similar edges
Sourcepub fn search_similar_hyperedges(
&self,
query: &[f32],
k: usize,
) -> Result<Vec<(String, f32)>>
pub fn search_similar_hyperedges( &self, query: &[f32], k: usize, ) -> Result<Vec<(String, f32)>>
Search for similar hyperedges
Sourcepub fn extract_embedding(
&self,
properties: &Properties,
) -> Result<Option<Vec<f32>>>
pub fn extract_embedding( &self, properties: &Properties, ) -> Result<Option<Vec<f32>>>
Extract embedding from properties
Sourcepub fn stats(&self) -> HybridIndexStats
pub fn stats(&self) -> HybridIndexStats
Get index statistics
Auto Trait Implementations§
impl Freeze for HybridIndex
impl !RefUnwindSafe for HybridIndex
impl Send for HybridIndex
impl Sync for HybridIndex
impl Unpin for HybridIndex
impl !UnwindSafe for HybridIndex
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request