From d42f4864b1238de41e5232503ab8c2da3ed716a0 Mon Sep 17 00:00:00 2001 From: B Harsha Kashyap Date: Wed, 11 Feb 2026 09:16:24 +0000 Subject: [PATCH 1/2] Add missing functions from index to wrapped_async.rs --- diskann-providers/src/index/wrapped_async.rs | 135 ++++++++++++++++++- 1 file changed, 132 insertions(+), 3 deletions(-) diff --git a/diskann-providers/src/index/wrapped_async.rs b/diskann-providers/src/index/wrapped_async.rs index b3b07e626..247d7d734 100644 --- a/diskann-providers/src/index/wrapped_async.rs +++ b/diskann-providers/src/index/wrapped_async.rs @@ -8,12 +8,16 @@ use std::{num::NonZeroUsize, sync::Arc}; use diskann::{ ANNResult, graph::{ - self, ConsolidateKind, InplaceDeleteMethod, + self, ConsolidateKind, InplaceDeleteMethod, RangeSearchParams, SearchParams, glue::{ - self, AsElement, InplaceDeleteStrategy, InsertStrategy, PruneStrategy, SearchStrategy, + self, AsElement, IdIterator, InplaceDeleteStrategy, InsertStrategy, PruneStrategy, + SearchStrategy, + }, + index::{ + DegreeStats, PartitionedNeighbors, QueryLabelProvider, SearchState, SearchStats, }, - index::{DegreeStats, PartitionedNeighbors, SearchState, SearchStats}, search::Knn, + search::record::SearchRecord, search_output_buffer, }, neighbor::Neighbor, @@ -299,6 +303,131 @@ where )) } + #[allow(clippy::too_many_arguments)] + pub fn multihop_search( + &self, + strategy: &S, + context: &DP::Context, + query: &T, + search_params: &SearchParams, + output: &mut OB, + query_label_evaluator: &dyn QueryLabelProvider, + ) -> ANNResult + where + T: Sync + ?Sized, + S: SearchStrategy, + O: Send, + OB: search_output_buffer::SearchOutputBuffer + Send, + { + self.handle.block_on(self.inner.multihop_search( + strategy, + context, + query, + search_params, + output, + query_label_evaluator, + )) + } + + pub fn multi_inplace_delete( + &self, + strategy: S, + context: &DP::Context, + ids: Arc<[DP::ExternalId]>, + num_to_replace: usize, + inplace_delete_method: InplaceDeleteMethod, + ) -> ANNResult<()> + where + Self: 'static + Send + Sync, + S: InplaceDeleteStrategy + + for<'a> SearchStrategy> + + Send + + Sync + + Clone, + DP: Delete + Send + Sync, + { + self.handle.block_on(self.inner.multi_inplace_delete( + strategy, + context, + ids, + num_to_replace, + inplace_delete_method, + )) + } + + #[allow(clippy::too_many_arguments)] + pub fn search_recorded( + &self, + strategy: &S, + context: &DP::Context, + query: &T, + search_params: &SearchParams, + output: &mut OB, + search_record: &mut SR, + ) -> ANNResult + where + T: Sync + ?Sized, + S: SearchStrategy, + O: Send, + OB: search_output_buffer::SearchOutputBuffer + Send + ?Sized, + SR: SearchRecord + ?Sized, + { + self.handle.block_on(self.inner.search_recorded( + strategy, + context, + query, + search_params, + output, + search_record, + )) + } + + #[allow(clippy::too_many_arguments)] + pub fn flat_search<'a, S, T, O, OB, I>( + &'a self, + strategy: &'a S, + context: &'a DP::Context, + query: &T, + vector_filter: &(dyn Fn(&DP::ExternalId) -> bool + Send + Sync), + search_params: &SearchParams, + output: &mut OB, + ) -> ANNResult + where + T: ?Sized, + S: SearchStrategy: IdIterator>, + I: Iterator, + O: Send, + OB: search_output_buffer::SearchOutputBuffer + Send, + { + self.handle.block_on(self.inner.flat_search( + strategy, + context, + query, + vector_filter, + search_params, + output, + )) + } + + #[allow(clippy::type_complexity)] + pub fn range_search( + &self, + strategy: &S, + context: &DP::Context, + query: &T, + search_params: &RangeSearchParams, + ) -> ANNResult<(SearchStats, Vec, Vec)> + where + T: Sync + ?Sized, + S: SearchStrategy, + O: Send + Default + Clone, + { + self.handle.block_on( + self.inner + .range_search(strategy, context, query, search_params), + ) + } + pub fn count_reachable_nodes( &self, start_points: &[DP::InternalId], From ac4e5bd78c178ea820420a304e47a30acbe69e61 Mon Sep 17 00:00:00 2001 From: B Harsha Kashyap Date: Thu, 5 Mar 2026 10:08:31 +0000 Subject: [PATCH 2/2] Only have multihop_search --- diskann-providers/src/index/wrapped_async.rs | 99 -------------------- 1 file changed, 99 deletions(-) diff --git a/diskann-providers/src/index/wrapped_async.rs b/diskann-providers/src/index/wrapped_async.rs index 247d7d734..8bce5eb00 100644 --- a/diskann-providers/src/index/wrapped_async.rs +++ b/diskann-providers/src/index/wrapped_async.rs @@ -329,105 +329,6 @@ where )) } - pub fn multi_inplace_delete( - &self, - strategy: S, - context: &DP::Context, - ids: Arc<[DP::ExternalId]>, - num_to_replace: usize, - inplace_delete_method: InplaceDeleteMethod, - ) -> ANNResult<()> - where - Self: 'static + Send + Sync, - S: InplaceDeleteStrategy - + for<'a> SearchStrategy> - + Send - + Sync - + Clone, - DP: Delete + Send + Sync, - { - self.handle.block_on(self.inner.multi_inplace_delete( - strategy, - context, - ids, - num_to_replace, - inplace_delete_method, - )) - } - - #[allow(clippy::too_many_arguments)] - pub fn search_recorded( - &self, - strategy: &S, - context: &DP::Context, - query: &T, - search_params: &SearchParams, - output: &mut OB, - search_record: &mut SR, - ) -> ANNResult - where - T: Sync + ?Sized, - S: SearchStrategy, - O: Send, - OB: search_output_buffer::SearchOutputBuffer + Send + ?Sized, - SR: SearchRecord + ?Sized, - { - self.handle.block_on(self.inner.search_recorded( - strategy, - context, - query, - search_params, - output, - search_record, - )) - } - - #[allow(clippy::too_many_arguments)] - pub fn flat_search<'a, S, T, O, OB, I>( - &'a self, - strategy: &'a S, - context: &'a DP::Context, - query: &T, - vector_filter: &(dyn Fn(&DP::ExternalId) -> bool + Send + Sync), - search_params: &SearchParams, - output: &mut OB, - ) -> ANNResult - where - T: ?Sized, - S: SearchStrategy: IdIterator>, - I: Iterator, - O: Send, - OB: search_output_buffer::SearchOutputBuffer + Send, - { - self.handle.block_on(self.inner.flat_search( - strategy, - context, - query, - vector_filter, - search_params, - output, - )) - } - - #[allow(clippy::type_complexity)] - pub fn range_search( - &self, - strategy: &S, - context: &DP::Context, - query: &T, - search_params: &RangeSearchParams, - ) -> ANNResult<(SearchStats, Vec, Vec)> - where - T: Sync + ?Sized, - S: SearchStrategy, - O: Send + Default + Clone, - { - self.handle.block_on( - self.inner - .range_search(strategy, context, query, search_params), - ) - } - pub fn count_reachable_nodes( &self, start_points: &[DP::InternalId],