pub struct SearchExtension { /* private fields */ }Expand description
CommandExtension implementation that routes FT.*
commands and the HSET interception path through a shared
VectorRegistry and SuggestionRegistry.
Every cloneable handle to a SearchExtension references
the same registries; embedders who want to inspect the
live FT.* surface (admin paths, tests) can clone the
registry handles out via SearchExtension::registry
and SearchExtension::suggestions.
Implementations§
Source§impl SearchExtension
impl SearchExtension
Sourcepub fn new(registry: Arc<VectorRegistry>) -> Self
pub fn new(registry: Arc<VectorRegistry>) -> Self
Wrap an existing registry in a SearchExtension.
The suggestion-dictionary registry is allocated
fresh; callers that want to share it explicitly can
use Self::with_suggestions.
Sourcepub fn with_suggestions(
registry: Arc<VectorRegistry>,
suggestions: Arc<SuggestionRegistry>,
) -> Self
pub fn with_suggestions( registry: Arc<VectorRegistry>, suggestions: Arc<SuggestionRegistry>, ) -> Self
Wrap both registries in a SearchExtension.
Sourcepub fn registry(&self) -> &Arc<VectorRegistry> ⓘ
pub fn registry(&self) -> &Arc<VectorRegistry> ⓘ
Borrow the wrapped vector-index registry.
Sourcepub fn suggestions(&self) -> &Arc<SuggestionRegistry> ⓘ
pub fn suggestions(&self) -> &Arc<SuggestionRegistry> ⓘ
Borrow the wrapped suggestion-dictionary registry.
Trait Implementations§
Source§impl Clone for SearchExtension
impl Clone for SearchExtension
Source§fn clone(&self) -> SearchExtension
fn clone(&self) -> SearchExtension
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CommandExtension for SearchExtension
impl CommandExtension for SearchExtension
Source§fn handles_msg_type(&self, ty: MsgType) -> bool
fn handles_msg_type(&self, ty: MsgType) -> bool
True when the parsed
MsgType is one this extension
wants to dispatch. The dispatcher only invokes
Self::try_dispatch when this returns true.Source§fn try_dispatch(&self, args: &[&[u8]]) -> Option<Vec<u8>>
fn try_dispatch(&self, args: &[&[u8]]) -> Option<Vec<u8>>
Try to dispatch a command.
args is the parsed RESP
argument vector starting with the command keyword
(e.g. [b"FT.SEARCH", b"idx", ...]). Read moreSource§fn try_intercept_hset(&self, args: &[&[u8]]) -> HsetOutcome
fn try_intercept_hset(&self, args: &[&[u8]]) -> HsetOutcome
Inspect an HSET argument list and, if it matches a
registered prefix / shape, perform any side-effects the
extension wants.
args is [key, f1, v1, f2, v2, ...]
(without the leading HSET keyword). Read moreSource§impl Debug for SearchExtension
impl Debug for SearchExtension
Auto Trait Implementations§
impl !RefUnwindSafe for SearchExtension
impl !UnwindSafe for SearchExtension
impl Freeze for SearchExtension
impl Send for SearchExtension
impl Sync for SearchExtension
impl Unpin for SearchExtension
impl UnsafeUnpin for SearchExtension
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.