Skip to main content

VSimOptions

Struct VSimOptions 

Source
pub struct VSimOptions<'a> { /* private fields */ }
Expand description

Options for the vsim command.

Implementations§

Source§

impl<'a> VSimOptions<'a>

Source

pub fn with_scores(self) -> Self

returns the similarity score (from 1 to 0) alongside each result. A score of 1 is identical; 0 is the opposite.

Source

pub fn with_attributes(self) -> Self

returns, for each element, the JSON attribute associated with the element or NULL when no attributes are present.

Source

pub fn count(self, num: u32) -> Self

Limits the number of returned results to num.

Source

pub fn epsilon(self, delta: f32) -> Self

is a floating point number between 0 and 1. It is used to retrieve elements that have a distance that is no further than the specified delta. In vector sets, returned elements have a similarity score (when compared to the query vector) that is between 1 and 0, where 1 means identical and 0 means opposite vectors. For example, if the EPSILON option is specified with an argument of 0.2, it means only elements that have a similarity of 0.8 or better (a distance < 0.2) are returned. This is useful when you specify a large COUNT, but you don’t want elements that are too far away from the query vector.

Source

pub fn ef(self, search_exploration_factor: u32) -> Self

Controls the search effort.

Higher values explore more nodes, improving recall at the cost of speed. Typical values range from 50 to 1000.

Source

pub fn filter(self, expression: &'a str) -> Self

Applies a filter expression to restrict matching elements. See the filtered search section for syntax details.

Source

pub fn filter_ef(self, max_filtering_effort: u32) -> Self

Limits the number of filtering attempts for the FILTER expression.

See the filtered search section for more.

Source

pub fn truth(self) -> Self

Forces an exact linear scan of all elements, bypassing the HNSW graph.

Use for benchmarking or to calculate recall. This is significantly slower (O(N)).

Source

pub fn no_thread(self) -> Self

Executes the search in the main thread instead of a background thread.

Useful for small vector sets or benchmarks. This may block the server during execution.

Trait Implementations§

Source§

impl<'a> Default for VSimOptions<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> Serialize for VSimOptions<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for VSimOptions<'a>

§

impl<'a> RefUnwindSafe for VSimOptions<'a>

§

impl<'a> Send for VSimOptions<'a>

§

impl<'a> Sync for VSimOptions<'a>

§

impl<'a> Unpin for VSimOptions<'a>

§

impl<'a> UnsafeUnpin for VSimOptions<'a>

§

impl<'a> UnwindSafe for VSimOptions<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more