Struct FtFieldSchema

Source
pub struct FtFieldSchema { /* private fields */ }
Available on crate feature redis-search only.
Expand description

field schema for the ft_create command

Implementations§

Source§

impl FtFieldSchema

Source

pub fn identifier<N: SingleArg>(identifier: N) -> Self

  • For hashes, is a field name within the hash.
  • For JSON, the identifier is a JSON Path expression.
Source

pub fn as_attribute<A: SingleArg>(self, as_attribute: A) -> Self

Defines the attribute associated to the identifier.

For example, you can use this feature to alias a complex JSONPath expression with more memorable (and easier to type) name.

Source

pub fn field_type(self, field_type: FtFieldType) -> Self

The field type.

Mandatory option to be used after identifier or as_attribute

Source

pub fn sortable(self) -> Self

Numeric, tag (not supported with JSON) or text attributes can have the optional SORTABLE argument.

As the user sorts the results by the value of this attribute, the results will be available with very low latency. (this adds memory overhead so consider not to declare it on large text attributes).

Source

pub fn unf(self) -> Self

By default, SORTABLE applies a normalization to the indexed value (characters set to lowercase, removal of diacritics). When using un-normalized form (UNF), you can disable the normalization and keep the original form of the value.

Source

pub fn nostem(self) -> Self

Text attributes can have the NOSTEM argument which will disable stemming when indexing its values. This may be ideal for things like proper names.

Source

pub fn noindex(self) -> Self

Attributes can have the NOINDEX option, which means they will not be indexed.

This is useful in conjunction with SORTABLE, to create attributes whose update using PARTIAL will not cause full reindexing of the document. If an attribute has NOINDEX and doesn’t have SORTABLE, it will just be ignored by the index.

Source

pub fn phonetic(self, matcher: FtPhoneticMatcher) -> Self

Declaring a text attribute as PHONETIC will perform phonetic matching on it in searches by default.

The obligatory matcher argument specifies the phonetic algorithm and language used.

Source

pub fn weight(self, weight: f64) -> Self

for TEXT attributes, declares the importance of this attribute when calculating result accuracy.

This is a multiplication factor, and defaults to 1 if not specified.

Source

pub fn separator(self, sep: char) -> Self

for TAG attributes, indicates how the text contained in the attribute is to be split into individual tags. The default is ,. The value must be a single character.

Source

pub fn case_sensitive(self) -> Self

for TAG attributes, keeps the original letter cases of the tags. If not specified, the characters are converted to lowercase.

Source

pub fn with_suffix_trie(self) -> Self

for TEXT and TAG attributes, keeps a suffix trie with all terms which match the suffix.

It is used to optimize contains (foo) and suffix (*foo) queries. Otherwise, a brute-force search on the trie is performed. If suffix trie exists for some fields, these queries will be disabled for other fields.

Trait Implementations§

Source§

impl Default for FtFieldSchema

Source§

fn default() -> FtFieldSchema

Returns the “default value” for a type. Read more
Source§

impl ToArgs for FtFieldSchema

Source§

fn write_args(&self, args: &mut CommandArgs)

Write this Rust type as one ore multiple args into CommandArgs. Read more
Source§

fn num_args(&self) -> usize

Number arguments generated by this Rust type

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MultipleArgsCollection<T> for T
where T: ToArgs,