pub struct GraphAwareSearch { /* private fields */ }Expand description
Graph-aware vector search engine
Implementations§
Source§impl GraphAwareSearch
impl GraphAwareSearch
pub fn new(config: GraphAwareConfig) -> Self
Sourcepub fn register_resource_graph(&mut self, resource: String, graphs: Vec<String>)
pub fn register_resource_graph(&mut self, resource: String, graphs: Vec<String>)
Register a resource as belonging to specific graphs
Sourcepub fn search_in_graph(
&self,
vector_store: &VectorStore,
query_text: &str,
graph_context: &GraphContext,
limit: usize,
) -> Result<Vec<GraphAwareSearchResult>>
pub fn search_in_graph( &self, vector_store: &VectorStore, query_text: &str, graph_context: &GraphContext, limit: usize, ) -> Result<Vec<GraphAwareSearchResult>>
Perform graph-aware vector search
Sourcepub fn search_single_graph(
&self,
vector_store: &VectorStore,
query_text: &str,
graph_uri: &str,
limit: usize,
) -> Result<Vec<GraphAwareSearchResult>>
pub fn search_single_graph( &self, vector_store: &VectorStore, query_text: &str, graph_uri: &str, limit: usize, ) -> Result<Vec<GraphAwareSearchResult>>
Search within a specific named graph
Sourcepub fn update_graph_metadata(
&mut self,
graph_uri: String,
metadata: GraphMetadata,
)
pub fn update_graph_metadata( &mut self, graph_uri: String, metadata: GraphMetadata, )
Update graph metadata for optimization
Sourcepub fn get_graph_stats(
&self,
graph_uri: &str,
) -> Option<(usize, Option<&GraphMetadata>)>
pub fn get_graph_stats( &self, graph_uri: &str, ) -> Option<(usize, Option<&GraphMetadata>)>
Get graph statistics
Sourcepub fn clear_caches(&mut self)
pub fn clear_caches(&mut self)
Clear graph caches
Sourcepub fn resource_in_graph(&self, resource: &str, graph_uri: &str) -> bool
pub fn resource_in_graph(&self, resource: &str, graph_uri: &str) -> bool
Check if a resource exists in a specific graph
Sourcepub fn get_resource_graphs(&self, resource: &str) -> Option<&HashSet<String>>
pub fn get_resource_graphs(&self, resource: &str) -> Option<&HashSet<String>>
Get all graphs containing a resource
Sourcepub fn cross_graph_similarity(
&self,
vector_store: &VectorStore,
resource1: &str,
graph1: &str,
resource2: &str,
graph2: &str,
) -> Result<f32>
pub fn cross_graph_similarity( &self, vector_store: &VectorStore, resource1: &str, graph1: &str, resource2: &str, graph2: &str, ) -> Result<f32>
Calculate cross-graph similarity
Sourcepub fn set_graph_hierarchy(
&mut self,
parent_child: HashMap<String, Vec<String>>,
)
pub fn set_graph_hierarchy( &mut self, parent_child: HashMap<String, Vec<String>>, )
Set graph hierarchy configuration
Sourcepub fn set_graph_weights(&mut self, weights: HashMap<String, f32>)
pub fn set_graph_weights(&mut self, weights: HashMap<String, f32>)
Set graph weights for ranking
Auto Trait Implementations§
impl Freeze for GraphAwareSearch
impl RefUnwindSafe for GraphAwareSearch
impl Send for GraphAwareSearch
impl Sync for GraphAwareSearch
impl Unpin for GraphAwareSearch
impl UnwindSafe for GraphAwareSearch
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.