pub struct QueryParser(/* private fields */);
Expand description
A type for building Query
objects from strings
Implementations§
Source§impl QueryParser
impl QueryParser
Sourcepub fn add_prefix<T>(
&mut self,
field: impl AsRef<str>,
prefix: impl Into<Option<T>>,
)
pub fn add_prefix<T>( &mut self, field: impl AsRef<str>, prefix: impl Into<Option<T>>, )
Add a free-text field term prefix
Sourcepub fn add_custom_prefix<T: FieldProcessor + Clone + 'static>(
&mut self,
field: impl AsRef<str>,
field_proc: T,
)
pub fn add_custom_prefix<T: FieldProcessor + Clone + 'static>( &mut self, field: impl AsRef<str>, field_proc: T, )
Add a free-text field term prefix backed by a custom FieldProcessor
Sourcepub fn add_custom_boolean_prefix<T, U>(
&mut self,
field: impl AsRef<str>,
field_proc: T,
grouping: impl Into<Option<U>>,
)
pub fn add_custom_boolean_prefix<T, U>( &mut self, field: impl AsRef<str>, field_proc: T, grouping: impl Into<Option<U>>, )
Register a FieldProcessor
for a boolean prefix
Sourcepub fn add_boolean_prefix<T, U>(
&mut self,
field: impl AsRef<str>,
prefix: impl Into<Option<T>>,
grouping: impl Into<Option<U>>,
)
pub fn add_boolean_prefix<T, U>( &mut self, field: impl AsRef<str>, prefix: impl Into<Option<T>>, grouping: impl Into<Option<U>>, )
Add a boolean term prefix, allowing the user to restrict a search with a boolean filter specified in the free text query
Sourcepub fn add_rangeprocessor<'g>(
&mut self,
marker: impl Into<String>,
slot: impl Into<Slot>,
range_proc: impl RangeProcessor + 'static,
is_suffix: bool,
can_repeat: bool,
grouping: impl Into<Option<&'g str>>,
)
pub fn add_rangeprocessor<'g>( &mut self, marker: impl Into<String>, slot: impl Into<Slot>, range_proc: impl RangeProcessor + 'static, is_suffix: bool, can_repeat: bool, grouping: impl Into<Option<&'g str>>, )
Register a RangeProcessor
Sourcepub fn set_stemmer(&mut self, stemmer: impl AsRef<Stem>)
pub fn set_stemmer(&mut self, stemmer: impl AsRef<Stem>)
Set the Stem
to be used with this QueryParser
Sourcepub fn set_stemming_strategy(
&mut self,
strategy: impl Into<QueryParser_stem_strategy>,
)
pub fn set_stemming_strategy( &mut self, strategy: impl Into<QueryParser_stem_strategy>, )
Set the StemStrategy
Sourcepub fn set_stopper<T: Stopper + 'static>(
&mut self,
stopper: impl Into<Option<T>>,
)
pub fn set_stopper<T: Stopper + 'static>( &mut self, stopper: impl Into<Option<T>>, )
Set the Stopper
to be used with this QueryParser
Sourcepub fn parse_query<T>(
&mut self,
query: impl AsRef<str>,
flags: impl Into<Option<QueryParser_feature_flag>>,
default_prefix: impl Into<Option<T>>,
) -> Query
pub fn parse_query<T>( &mut self, query: impl AsRef<str>, flags: impl Into<Option<QueryParser_feature_flag>>, default_prefix: impl Into<Option<T>>, ) -> Query
Parse the given query text into a Query
instance
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryParser
impl !RefUnwindSafe for QueryParser
impl !Send for QueryParser
impl !Sync for QueryParser
impl Unpin for QueryParser
impl UnwindSafe for QueryParser
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