PayloadIndexManager

Struct PayloadIndexManager 

Source
pub struct PayloadIndexManager { /* private fields */ }
Expand description

Manager for payload indices

Implementations§

Source§

impl PayloadIndexManager

Source

pub fn new() -> Self

Create a new payload index manager

Source

pub fn create_index(&mut self, field: &str, index_type: IndexType) -> Result<()>

Create an index on a field

Source

pub fn drop_index(&mut self, field: &str) -> Result<()>

Drop an index

Source

pub fn has_index(&self, field: &str) -> bool

Check if an index exists for a field

Source

pub fn get_index(&self, field: &str) -> Option<&PayloadIndex>

Get an index by field name

Source

pub fn get_index_mut(&mut self, field: &str) -> Option<&mut PayloadIndex>

Get a mutable index by field name

Source

pub fn index_payload(&mut self, vector_id: &str, payload: &Value) -> Result<()>

Index a payload for a vector

Source

pub fn remove_payload(&mut self, vector_id: &str, payload: &Value) -> Result<()>

Remove a payload from all indices

Source

pub fn clear_vector(&mut self, vector_id: &str)

Clear all entries for a vector ID from all indices

Source

pub fn indexed_fields(&self) -> Vec<String>

Get all indexed fields

Source

pub fn index_count(&self) -> usize

Get the number of indices

Trait Implementations§

Source§

impl Debug for PayloadIndexManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PayloadIndexManager

Source§

fn default() -> PayloadIndexManager

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

Auto Trait Implementations§

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.