Struct tantivy::schema::Schema [−][src]
pub struct Schema(_);
Expand description
Tantivy has a very strict schema. You need to specify in advance, whether a field is indexed or not, stored or not, and RAM-based or not.
This is done by creating a schema object, and setting up the fields one by one. It is for the moment impossible to remove fields.
Examples
use tantivy::schema::*;
let mut schema_builder = Schema::builder();
let id_field = schema_builder.add_text_field("id", STRING);
let title_field = schema_builder.add_text_field("title", TEXT);
let body_field = schema_builder.add_text_field("body", TEXT);
let schema = schema_builder.build();
Implementations
Return the FieldEntry
associated to a Field
.
Return the field name for a given Field
.
Return the list of all the Field
s.
Creates a new builder.
Returns the field option associated with a given name.
pub fn convert_named_doc(
&self,
named_doc: NamedFieldDocument
) -> Result<Document, DocParsingError>
pub fn convert_named_doc(
&self,
named_doc: NamedFieldDocument
) -> Result<Document, DocParsingError>
Create a named document off the doc.
Create a named document off the doc.
Encode the schema in JSON.
Encoding a document cannot fail.
Build a document object from a json-object.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Schema
impl UnwindSafe for Schema
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more