pub struct Range<DP, T, S>where
DP: DataProvider,{ /* private fields */ }Expand description
A built-in helper for benchmarking the range search method
[graph::DiskANNIndex::range_search].
This is intended to be used in conjunction with search::search or
search::search_all and provides some basic additional metrics for
the latter. Result aggregation for search::search_all is provided
by the Aggregator type.
The provided implementation of Search accepts
graph::search::Range and returns Metrics as additional output.
Implementations§
Source§impl<DP, T, S> Range<DP, T, S>where
DP: DataProvider,
impl<DP, T, S> Range<DP, T, S>where
DP: DataProvider,
Sourcepub fn new(
index: Arc<DiskANNIndex<DP>>,
queries: Arc<Matrix<T>>,
strategy: Strategy<S>,
) -> Result<Arc<Self>>
pub fn new( index: Arc<DiskANNIndex<DP>>, queries: Arc<Matrix<T>>, strategy: Strategy<S>, ) -> Result<Arc<Self>>
Construct a new Range searcher.
If strategy is one of the container variants of Strategy, its length
must match the number of rows in queries. If this is the case, then the
strategies will have a querywise correspondence (see search::SearchResults)
with the query matrix.
§Errors
Returns an error if the number of elements in strategy is not compatible with
the number of rows in queries.
Trait Implementations§
Source§impl<DP, T, S> Search for Range<DP, T, S>where
DP: DataProvider<Context: Default, ExternalId: Id>,
S: for<'a> DefaultSearchStrategy<DP, &'a [T], DP::ExternalId> + Clone + AsyncFriendly,
T: AsyncFriendly + Clone,
impl<DP, T, S> Search for Range<DP, T, S>where
DP: DataProvider<Context: Default, ExternalId: Id>,
S: for<'a> DefaultSearchStrategy<DP, &'a [T], DP::ExternalId> + Clone + AsyncFriendly,
T: AsyncFriendly + Clone,
Source§type Id = <DP as DataProvider>::ExternalId
type Id = <DP as DataProvider>::ExternalId
Source§type Parameters = Range
type Parameters = Range
Source§type Output = Metrics
type Output = Metrics
search and allows implementation-specific data to be returned.Source§fn num_queries(&self) -> usize
fn num_queries(&self) -> usize
search and
search_all will invoke Search::search for each index in 0..N where
N is the returned value of this method.Source§fn id_count(&self, parameters: &Self::Parameters) -> IdCount
fn id_count(&self, parameters: &Self::Parameters) -> IdCount
Auto Trait Implementations§
impl<DP, T, S> Freeze for Range<DP, T, S>where
S: Freeze,
impl<DP, T, S> !RefUnwindSafe for Range<DP, T, S>
impl<DP, T, S> Send for Range<DP, T, S>
impl<DP, T, S> Sync for Range<DP, T, S>
impl<DP, T, S> Unpin for Range<DP, T, S>where
S: Unpin,
impl<DP, T, S> UnsafeUnpin for Range<DP, T, S>where
S: UnsafeUnpin,
impl<DP, T, S> !UnwindSafe for Range<DP, T, S>
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
Source§impl<T> DispatchRule<T> for T
impl<T> DispatchRule<T> for T
Source§type Error = Infallible
type Error = Infallible
convert.Source§fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
Source§fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
Source§fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
Source§fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
try_match but returns a reason for a failed score. Read more