pub struct QueryParser { /* private fields */ }Expand description
Query parser for the search engine. Supports:
- Simple term queries:
hello world - Phrase queries:
"exact phrase" - Boolean AND:
hello AND worldor+hello +world - Boolean OR:
hello OR world - Boolean NOT:
-excludeorNOT exclude - Fuzzy queries:
term~orterm~2 - Prefix queries:
prefix* - Pinyin flag:
pinyin:ni haoorpy:你好
Implementations§
Source§impl QueryParser
impl QueryParser
pub fn new() -> Self
pub fn with_fuzzy_distance(distance: usize) -> Self
Sourcepub fn parse(&self, input: &str) -> ParsedQuery
pub fn parse(&self, input: &str) -> ParsedQuery
Parse a query string into a ParsedQuery
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 UnsafeUnpin 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