pub fn tokenizer_for_field(&self, field: Field) -> Result<BoxedTokenizer> {
        let field_entry = self.schema.get_field_entry(field);
        let field_type = field_entry.field_type();
        let tokenizer_manager: &TokenizerManager = self.tokenizers();
        let tokenizer_name_opt: Option<BoxedTokenizer> = match field_type {
            FieldType::Str(text_options) => text_options
                .get_indexing_options()
                .map(|text_indexing_options| text_indexing_options.tokenizer().to_string())
                .and_then(|tokenizer_name| tokenizer_manager.get(&tokenizer_name)),
            _ => None,
        };
        match tokenizer_name_opt {
            Some(tokenizer) => Ok(tokenizer),
            None => Err(TantivyError::SchemaError(format!(
                "{:?} is not a text field.",
                field_entry.name()
            ))),
        }
    }
/// Helper to access the tokenizer associated to a specific field.
Helper to access the tokenizer associated to a specific field.
Helper to access the tokenizer associated to a specific field .
pub fn tokenizer_for_field(&self, field: Field) -> Result<BoxedTokenizer> {
        let field_entry = self.schema.get_field_entry(field);
        let field_type = field_entry.field_type();
        let tokenizer_manager: &TokenizerManager = self.tokenizers();
        let tokenizer_name_opt: Option<BoxedTokenizer> = match field_type {
            FieldType::Str(text_options) => text_options
                .get_indexing_options()
                .map(|text_indexing_options| text_indexing_options.tokenizer().to_string())
                .and_then(|tokenizer_name| tokenizer_manager.get(&tokenizer_name)),
            _ => None,
        };
        match tokenizer_name_opt {
            Some(tokenizer) => Ok(tokenizer),
            None => Err(TantivyError::SchemaError(format!(
                "{:?} is not a text field.",
                field_entry.name()
            ))),
        }
    }
pub fn tokenizer_for_field ( & self , field : Field ) -> Result < BoxedTokenizer > { let field_entry = self . schema . get_field_entry ( field ) ; let field_type = field_entry . field_type ( ) ; let tokenizer_manager : & TokenizerManager = self . tokenizers ( ) ; let tokenizer_name_opt : Option < BoxedTokenizer > = match field_type { FieldType :: Str ( text_options ) => text_options . get_indexing_options ( ) . map ( | text_indexing_options | text_indexing_options . tokenizer ( ) . to_string ( ) ) . and_then ( | tokenizer_name | tokenizer_manager . get ( & tokenizer_name ) ) , _ => None , } ; match tokenizer_name_opt { Some ( tokenizer ) => Ok ( tokenizer ) , None => Err ( TantivyError :: SchemaError ( format ! ( " " field_entry name ( ) ) ) ) , } }
Helper to access the tokenizer associated to a specific field.
Helper to access the tokenizer associated to a specific field .
&self
field
Field
&self
field
Field