[][src]Enum tantivy::schema::FieldType

pub enum FieldType {
    Str(TextOptions),
    U64(IntOptions),
    I64(IntOptions),
    F64(IntOptions),
    Date(IntOptions),
    HierarchicalFacet,
    Bytes,
}

A FieldType describes the type (text, u64) of a field as well as how it should be handled by tantivy.

Variants

String field type configuration

Unsigned 64-bits integers field type configuration

Signed 64-bits integers 64 field type configuration

64-bits float 64 field type configuration

Signed 64-bits Date 64 field type configuration,

HierarchicalFacet

Hierachical Facet

Bytes

Bytes (one per document)

Methods

impl FieldType[src]

pub fn value_type(&self) -> Type[src]

Returns the value type associated for this field.

pub fn is_indexed(&self) -> bool[src]

returns true iff the field is indexed.

pub fn get_index_record_option(&self) -> Option<IndexRecordOption>[src]

Given a field configuration, return the maximal possible IndexRecordOption available.

If the field is not indexed, then returns None.

pub fn value_from_json(
    &self,
    json: &JsonValue
) -> Result<Value, ValueParsingError>
[src]

Parses a field value from json, given the target FieldType.

Tantivy will not try to cast values. For instance, If the json value is the integer 3 and the target field is a Str, this method will return an Error.

Trait Implementations

impl Eq for FieldType[src]

impl Clone for FieldType[src]

impl PartialEq<FieldType> for FieldType[src]

impl Debug for FieldType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Fruit for T where
    T: Send + Downcast
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Downcast for T where
    T: Any
[src]