pub enum TokenizerSpec {
Named(String),
DynamicStem {
by: String,
default: Option<Language>,
stop_words: bool,
segmenter: Segmenter,
},
}Expand description
Parsed form of a tokenizer name in the schema.
Plain names refer to a registered tokenizer (simple, en_stem, …).
stem(by: <field>, default: <language|simple>, stop_words: <bool>)
declares a DynamicStemmer whose per-document hint is read from
<field> in the same document. The canonical string form is stored in
FieldEntry::tokenizer, so index metadata needs no new field; specs
without stop_words render exactly as before.
Variants§
Named(String)
A registered tokenizer name.
DynamicStem
Dynamic stemmer hinted by another field of the document.
Fields
Implementations§
Source§impl TokenizerSpec
impl TokenizerSpec
Sourcepub fn parse(spec: &str) -> Result<TokenizerSpec, String>
pub fn parse(spec: &str) -> Result<TokenizerSpec, String>
Parse a tokenizer name or stem(...) spec.
Sourcepub fn hint_field(&self) -> Option<&str>
pub fn hint_field(&self) -> Option<&str>
Field whose values hint the tokenizer, for dynamic specs.
Sourcepub fn dynamic_tokenizer(&self) -> Option<BoxedTokenizer>
pub fn dynamic_tokenizer(&self) -> Option<BoxedTokenizer>
Build the tokenizer described by a dynamic spec.
Trait Implementations§
Source§impl Clone for TokenizerSpec
impl Clone for TokenizerSpec
Source§fn clone(&self) -> TokenizerSpec
fn clone(&self) -> TokenizerSpec
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 Debug for TokenizerSpec
impl Debug for TokenizerSpec
Source§impl Display for TokenizerSpec
impl Display for TokenizerSpec
impl Eq for TokenizerSpec
Source§impl PartialEq for TokenizerSpec
impl PartialEq for TokenizerSpec
impl StructuralPartialEq for TokenizerSpec
Auto Trait Implementations§
impl Freeze for TokenizerSpec
impl RefUnwindSafe for TokenizerSpec
impl Send for TokenizerSpec
impl Sync for TokenizerSpec
impl Unpin for TokenizerSpec
impl UnsafeUnpin for TokenizerSpec
impl UnwindSafe for TokenizerSpec
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> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<E> ResultError for E
impl<T> ResultType for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more