pub struct SearchIndex {
pub name: String,
pub prefix: String,
pub fields: Vec<SearchField>,
}Expand description
Search index definition
Fields§
§name: StringIndex name (will be prefixed with “idx:”)
prefix: StringKey prefix this index covers (e.g., “crdt:users:”)
fields: Vec<SearchField>Field definitions for the index
Implementations§
Source§impl SearchIndex
impl SearchIndex
Sourcepub fn new(name: impl Into<String>, prefix: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, prefix: impl Into<String>) -> Self
Create a new search index definition
Sourcepub fn text_at(
self,
name: impl Into<String>,
json_path: impl Into<String>,
) -> Self
pub fn text_at( self, name: impl Into<String>, json_path: impl Into<String>, ) -> Self
Add a text field with custom JSON path
Sourcepub fn text_sortable(self, name: impl Into<String>) -> Self
pub fn text_sortable(self, name: impl Into<String>) -> Self
Add a sortable text field
Sourcepub fn numeric_at(
self,
name: impl Into<String>,
json_path: impl Into<String>,
) -> Self
pub fn numeric_at( self, name: impl Into<String>, json_path: impl Into<String>, ) -> Self
Add a numeric field with custom JSON path
Sourcepub fn numeric_sortable(self, name: impl Into<String>) -> Self
pub fn numeric_sortable(self, name: impl Into<String>) -> Self
Add a sortable numeric field
Sourcepub fn numeric_sortable_at(
self,
name: impl Into<String>,
json_path: impl Into<String>,
) -> Self
pub fn numeric_sortable_at( self, name: impl Into<String>, json_path: impl Into<String>, ) -> Self
Add a sortable numeric field with custom JSON path
Sourcepub fn tag_at(
self,
name: impl Into<String>,
json_path: impl Into<String>,
) -> Self
pub fn tag_at( self, name: impl Into<String>, json_path: impl Into<String>, ) -> Self
Add a tag field with custom JSON path
Sourcepub fn to_ft_create_args(&self) -> Vec<String>
pub fn to_ft_create_args(&self) -> Vec<String>
Generate the FT.CREATE command arguments
Trait Implementations§
Source§impl Clone for SearchIndex
impl Clone for SearchIndex
Source§fn clone(&self) -> SearchIndex
fn clone(&self) -> SearchIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SearchIndex
impl RefUnwindSafe for SearchIndex
impl Send for SearchIndex
impl Sync for SearchIndex
impl Unpin for SearchIndex
impl UnwindSafe for SearchIndex
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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