Struct tantivy::schema::FieldEntry
source · pub struct FieldEntry { /* private fields */ }
Expand description
A FieldEntry
represents a field and its configuration.
Schema
are a collection of FieldEntry
It consists of
- a field name
- a field type, itself wrapping up options describing how the field should be indexed.
Implementations§
source§impl FieldEntry
impl FieldEntry
sourcepub fn new(field_name: String, field_type: FieldType) -> FieldEntry
pub fn new(field_name: String, field_type: FieldType) -> FieldEntry
Creates a new field entry given a name and a field type
sourcepub fn new_text(field_name: String, text_options: TextOptions) -> FieldEntry
pub fn new_text(field_name: String, text_options: TextOptions) -> FieldEntry
Creates a new text field entry.
sourcepub fn new_u64(field_name: String, int_options: NumericOptions) -> FieldEntry
pub fn new_u64(field_name: String, int_options: NumericOptions) -> FieldEntry
Creates a new u64 field entry.
sourcepub fn new_i64(field_name: String, int_options: NumericOptions) -> FieldEntry
pub fn new_i64(field_name: String, int_options: NumericOptions) -> FieldEntry
Creates a new i64 field entry.
sourcepub fn new_f64(field_name: String, f64_options: NumericOptions) -> FieldEntry
pub fn new_f64(field_name: String, f64_options: NumericOptions) -> FieldEntry
Creates a new f64 field entry.
sourcepub fn new_bool(field_name: String, bool_options: NumericOptions) -> FieldEntry
pub fn new_bool(field_name: String, bool_options: NumericOptions) -> FieldEntry
Creates a new bool field entry.
sourcepub fn new_date(field_name: String, date_options: DateOptions) -> FieldEntry
pub fn new_date(field_name: String, date_options: DateOptions) -> FieldEntry
Creates a new date field entry.
sourcepub fn new_ip_addr(field_name: String, ip_options: IpAddrOptions) -> FieldEntry
pub fn new_ip_addr(field_name: String, ip_options: IpAddrOptions) -> FieldEntry
Creates a new ip address field entry.
sourcepub fn new_facet(field_name: String, facet_options: FacetOptions) -> FieldEntry
pub fn new_facet(field_name: String, facet_options: FacetOptions) -> FieldEntry
Creates a field entry for a facet.
sourcepub fn new_bytes(field_name: String, bytes_options: BytesOptions) -> FieldEntry
pub fn new_bytes(field_name: String, bytes_options: BytesOptions) -> FieldEntry
Creates a field entry for a bytes field
sourcepub fn new_json(
field_name: String,
json_object_options: JsonObjectOptions
) -> FieldEntry
pub fn new_json( field_name: String, json_object_options: JsonObjectOptions ) -> FieldEntry
Creates a field entry for a json field
sourcepub fn field_type(&self) -> &FieldType
pub fn field_type(&self) -> &FieldType
Returns the field type
sourcepub fn is_indexed(&self) -> bool
pub fn is_indexed(&self) -> bool
Returns true if the field is indexed.
An indexed field is searchable.
sourcepub fn has_fieldnorms(&self) -> bool
pub fn has_fieldnorms(&self) -> bool
Returns true if the field is normed
sourcepub fn is_expand_dots_enabled(&self) -> bool
pub fn is_expand_dots_enabled(&self) -> bool
Returns true if the field has the expand dots option set (for json fields)
Trait Implementations§
source§impl Clone for FieldEntry
impl Clone for FieldEntry
source§fn clone(&self) -> FieldEntry
fn clone(&self) -> FieldEntry
Returns a copy of the value. Read more
1.0.0 · 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 FieldEntry
impl Debug for FieldEntry
source§impl<'de> Deserialize<'de> for FieldEntry
impl<'de> Deserialize<'de> for FieldEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for FieldEntry
impl PartialEq for FieldEntry
source§fn eq(&self, other: &FieldEntry) -> bool
fn eq(&self, other: &FieldEntry) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for FieldEntry
impl Serialize for FieldEntry
impl StructuralPartialEq for FieldEntry
Auto Trait Implementations§
impl Freeze for FieldEntry
impl RefUnwindSafe for FieldEntry
impl Send for FieldEntry
impl Sync for FieldEntry
impl Unpin for FieldEntry
impl UnwindSafe for FieldEntry
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.