Struct rustis::FtCreateOptions

source ·
pub struct FtCreateOptions { /* private fields */ }
Available on crate feature redis-search only.
Expand description

Options for the ft_create command

Implementations§

currently supports HASH (default) and JSON. To index JSON, you must have the RedisJSON module installed.

tells the index which keys it should index.

You can add several prefixes to index. Because the argument is optional, the default is * (all keys).

filter expression with the full RediSearch aggregation expression language.

It is possible to use @__key to access the key that was just added/changed. A field can be used to set field name by passing FILTER @indexName=="myindexname".

if set, indicates the default language for documents in the index.

Default to English.

A stemmer is used for the supplied language during indexing. If an unsupported language is sent, the command returns an error. The supported languages are Arabic, Basque, Catalan, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian, Indonesian, Irish, Italian, Lithuanian, Nepali, Norwegian, Portuguese, Romanian, Russian, Spanish, Swedish, Tamil, Turkish, and Chinese.

When adding Chinese language documents, set LANGUAGE chinese for the indexer to properly tokenize the terms. If you use the default language, then search terms are extracted based on punctuation characters and whitespace. The Chinese language tokenizer makes use of a segmentation algorithm (via Friso), which segments text and checks it against a predefined dictionary. See Stemming for more information.

document attribute set as the document language.

default score for documents in the index.

Default score is 1.0.

document attribute that you use as the document rank based on the user ranking.

Ranking must be between 0.0 and 1.0. If not set, the default score is 1.

document attribute that you use as a binary safe payload string to the document that can be evaluated at query time by a custom scoring function or retrieved to the client.

forces RediSearch to encode indexes as if there were more than 32 text attributes, which allows you to add additional attributes (beyond 32) using ft_alter.

For efficiency, RediSearch encodes indexes differently if they are created with less than 32 text attributes.

does not store term offsets for documents.

It saves memory, but does not allow exact searches or highlighting. It implies NOHL.

creates a lightweight temporary index that expires after a specified period of inactivity.

  • expiration_sec - index will expire after this duration in seconds.

The internal idle timer is reset whenever the index is searched or added to. Because such indexes are lightweight, you can create thousands of such indexes without negative performance implications and, therefore, you should consider using SKIPINITIALSCAN to avoid costly scanning.

conserves storage space and memory by disabling highlighting support.

If set, the corresponding byte offsets for term positions are not stored. NOHL is also implied by NOOFFSETS.

does not store attribute bits for each term.

It saves memory, but it does not allow filtering by specific attributes.

avoids saving the term frequencies in the index.

It saves memory, but does not allow sorting based on the frequencies of a given term within the document.

if set, does not scan and index.

sets the index with a custom stopword list, to be ignored during indexing and search time.

Arguments
  • stop_words - a list of stopword arguments.

If not set, FT.CREATE takes the default list of stopwords. If count is set to 0, the index does not have stopwords.

Trait Implementations§

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

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more