#[non_exhaustive]pub struct QueryOptions {
pub rerank: Option<usize>,
pub nprobe: Option<usize>,
pub exact: bool,
pub filter: Option<Predicate>,
}Expand description
Settings for Namespace::query_with.
New fields may be added, so build one from default() and the setters.
§Examples
use itzma_core::QueryOptions;
let every_row = QueryOptions::default().rerank(None);
assert_eq!(every_row.rerank, None);
assert_eq!(QueryOptions::default().rerank, Some(4));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rerank: Option<usize>How many candidates an index gives for each hit wanted: an indexed
segment proposes rerank * top_k rows by approximate distance, and those
are rescored against the exact vectors. Bigger is slower and closer to the
exact answer. None proposes every row, which makes the answer equal the
flat scan’s. Must be at least 1.
nprobe: Option<usize>How many partitions of an index to search. None lets the index
choose from how many partitions it has. A bigger value costs more and
finds more true neighbors. Must be at least 1.
exact: boolIgnore every index and scan flat. The ground truth for measuring recall, and a way through a damaged index.
filter: Option<Predicate>Keep only documents whose attributes match this predicate.
Checked against the namespace’s attribute schema before any read, so an
undeclared field or an operator that does not fit its type is an error.
The result has fewer than top_k hits only when fewer live documents
match. A very selective filter can read the whole namespace, bounded by
the read budget.
Implementations§
Trait Implementations§
Source§impl Clone for QueryOptions
impl Clone for QueryOptions
Source§impl Debug for QueryOptions
impl Debug for QueryOptions
Source§impl Default for QueryOptions
impl Default for QueryOptions
Source§impl<'de> Deserialize<'de> for QueryOptionswhere
QueryOptions: Default,
impl<'de> Deserialize<'de> for QueryOptionswhere
QueryOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for QueryOptions
impl PartialEq for QueryOptions
Source§impl Serialize for QueryOptions
impl Serialize for QueryOptions
impl StructuralPartialEq for QueryOptions
Auto Trait Implementations§
impl Forget for QueryOptions
impl Freeze for QueryOptionswhere
*const u8 is !null: Freeze,
PhantomData<Predicate>: Freeze,
*const Predicate is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<f64>: Freeze,
PhantomData<String>: Freeze,
PhantomData<AttrValue>: Freeze,
impl Move for QueryOptions
impl RefUnwindSafe for QueryOptions
impl Send for QueryOptions
impl Sync for QueryOptions
impl Unpin for QueryOptions
impl UnsafeUnpin for QueryOptionswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Predicate>: UnsafeUnpin,
*const Predicate is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<f64>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<AttrValue>: UnsafeUnpin,
impl UnwindSafe for QueryOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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