Trait rustis::commands::SearchCommands
source · pub trait SearchCommands<'a> {
Show 29 methods
// Provided methods
fn ft_aggregate<I, Q>(
self,
index: I,
query: Q,
options: FtAggregateOptions
) -> PreparedCommand<'a, Self, FtAggregateResult>
where Self: Sized,
I: SingleArg,
Q: SingleArg { ... }
fn ft_aliasadd<A, I>(
self,
alias: A,
index: I
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
A: SingleArg,
I: SingleArg { ... }
fn ft_aliasdel<A>(self, alias: A) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
A: SingleArg { ... }
fn ft_aliasupdate<A, I>(
self,
alias: A,
index: I
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
A: SingleArg,
I: SingleArg { ... }
fn ft_alter<I>(
self,
index: I,
skip_initial_scan: bool,
attribute: FtFieldSchema
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
I: SingleArg { ... }
fn ft_config_get<O, N, V, R>(
self,
option: O
) -> PreparedCommand<'a, Self, R>
where Self: Sized,
O: SingleArg,
N: PrimitiveResponse,
V: PrimitiveResponse,
R: KeyValueCollectionResponse<N, V> { ... }
fn ft_config_set<O, V>(
self,
option: O,
value: V
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
O: SingleArg,
V: SingleArg { ... }
fn ft_create<I, S>(
self,
index: I,
options: FtCreateOptions,
schema: S
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
I: SingleArg,
S: MultipleArgsCollection<FtFieldSchema> { ... }
fn ft_cursor_del<I>(
self,
index: I,
cursor_id: u64
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
I: SingleArg { ... }
fn ft_cursor_read<I>(
self,
index: I,
cursor_id: u64
) -> PreparedCommand<'a, Self, FtAggregateResult>
where Self: Sized,
I: SingleArg { ... }
fn ft_dictadd<D, T, TT>(
self,
dict: D,
terms: TT
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
D: SingleArg,
T: SingleArg,
TT: SingleArgCollection<T> { ... }
fn ft_dictdel<D, T, TT>(
self,
dict: D,
terms: TT
) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
D: SingleArg,
T: SingleArg,
TT: SingleArgCollection<T> { ... }
fn ft_dictdump<D, T, TT>(self, dict: D) -> PreparedCommand<'a, Self, TT>
where Self: Sized,
D: SingleArg,
T: PrimitiveResponse + DeserializeOwned,
TT: CollectionResponse<T> { ... }
fn ft_dropindex<I>(
self,
index: I,
dd: bool
) -> PreparedCommand<'a, Self, ()>
where Self: Sized,
I: SingleArg { ... }
fn ft_explain<I, Q, R>(
self,
index: I,
query: Q,
dialect_version: Option<u64>
) -> PreparedCommand<'a, Self, R>
where Self: Sized,
I: SingleArg,
Q: SingleArg,
R: PrimitiveResponse { ... }
fn ft_explaincli<I, Q, R, RR>(
self,
index: I,
query: Q,
dialect_version: Option<u64>
) -> PreparedCommand<'a, Self, RR>
where Self: Sized,
I: SingleArg,
Q: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> { ... }
fn ft_info(
self,
index: impl SingleArg
) -> PreparedCommand<'a, Self, FtInfoResult>
where Self: Sized { ... }
fn ft_list<R, RR>(self) -> PreparedCommand<'a, Self, RR>
where Self: Sized,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> { ... }
fn ft_profile_search<I, Q, QQ>(
self,
index: I,
limited: bool,
query: QQ
) -> PreparedCommand<'a, Self, FtProfileSearchResult>
where Self: Sized,
I: SingleArg,
Q: SingleArg,
QQ: SingleArgCollection<Q> { ... }
fn ft_profile_aggregate<I, Q, QQ>(
self,
index: I,
limited: bool,
query: QQ
) -> PreparedCommand<'a, Self, FtProfileAggregateResult>
where Self: Sized,
I: SingleArg,
Q: SingleArg,
QQ: SingleArgCollection<Q> { ... }
fn ft_search<I, Q>(
self,
index: I,
query: Q,
options: FtSearchOptions
) -> PreparedCommand<'a, Self, FtSearchResult>
where Self: Sized,
I: SingleArg,
Q: SingleArg { ... }
fn ft_spellcheck<I, Q>(
self,
index: I,
query: Q,
options: FtSpellCheckOptions
) -> PreparedCommand<'a, Self, FtSpellCheckResult>
where Self: Sized,
I: SingleArg,
Q: SingleArg { ... }
fn ft_syndump<I, R>(self, index: I) -> PreparedCommand<'a, Self, R>
where Self: Sized,
I: SingleArg,
R: KeyValueCollectionResponse<String, Vec<String>> { ... }
fn ft_synupdate<T: SingleArg>(
self,
index: impl SingleArg,
synonym_group_id: impl SingleArg,
skip_initial_scan: bool,
terms: impl SingleArgCollection<T>
) -> PreparedCommand<'a, Self, ()>
where Self: Sized { ... }
fn ft_tagvals<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>(
self,
index: impl SingleArg,
field_name: impl SingleArg
) -> PreparedCommand<'a, Self, RR>
where Self: Sized { ... }
fn ft_sugadd(
self,
key: impl SingleArg,
string: impl SingleArg,
score: f64,
options: FtSugAddOptions
) -> PreparedCommand<'a, Self, usize>
where Self: Sized { ... }
fn ft_sugdel(
self,
key: impl SingleArg,
string: impl SingleArg
) -> PreparedCommand<'a, Self, bool>
where Self: Sized { ... }
fn ft_sugget(
self,
key: impl SingleArg,
prefix: impl SingleArg,
options: FtSugGetOptions
) -> PreparedCommand<'a, Self, Vec<FtSuggestion>>
where Self: Sized { ... }
fn ft_suglen(self, key: impl SingleArg) -> PreparedCommand<'a, Self, usize>
where Self: Sized { ... }
}
redis-search
only.Expand description
A group of Redis commands related to RedisSearch
§See Also
Provided Methods§
sourcefn ft_aggregate<I, Q>(
self,
index: I,
query: Q,
options: FtAggregateOptions
) -> PreparedCommand<'a, Self, FtAggregateResult>
fn ft_aggregate<I, Q>( self, index: I, query: Q, options: FtAggregateOptions ) -> PreparedCommand<'a, Self, FtAggregateResult>
Run a search query on an index, and perform aggregate transformations on the results, extracting statistics etc from them
§Arguments
index
- index against which the query is executed.query
- is base filtering query that retrieves the documents.
It follows the exact same syntax as the search query,
including filters, unions, not, optional, and so on.options
- SeeFtAggregateOptions
§Returns
An instance of FtAggregateResult
§See Also
sourcefn ft_aliasadd<A, I>(self, alias: A, index: I) -> PreparedCommand<'a, Self, ()>
fn ft_aliasadd<A, I>(self, alias: A, index: I) -> PreparedCommand<'a, Self, ()>
sourcefn ft_aliasdel<A>(self, alias: A) -> PreparedCommand<'a, Self, ()>
fn ft_aliasdel<A>(self, alias: A) -> PreparedCommand<'a, Self, ()>
sourcefn ft_aliasupdate<A, I>(
self,
alias: A,
index: I
) -> PreparedCommand<'a, Self, ()>
fn ft_aliasupdate<A, I>( self, alias: A, index: I ) -> PreparedCommand<'a, Self, ()>
sourcefn ft_alter<I>(
self,
index: I,
skip_initial_scan: bool,
attribute: FtFieldSchema
) -> PreparedCommand<'a, Self, ()>
fn ft_alter<I>( self, index: I, skip_initial_scan: bool, attribute: FtFieldSchema ) -> PreparedCommand<'a, Self, ()>
Add a new attribute to the index.
Adding an attribute to the index causes any future document updates to use the new attribute when indexing and reindexing existing documents.
§Arguments
index
- index name to create.skip_initial_scan
- if set, does not scan and index.attribute
- attribute to add.
§See Also
sourcefn ft_config_get<O, N, V, R>(self, option: O) -> PreparedCommand<'a, Self, R>where
Self: Sized,
O: SingleArg,
N: PrimitiveResponse,
V: PrimitiveResponse,
R: KeyValueCollectionResponse<N, V>,
fn ft_config_get<O, N, V, R>(self, option: O) -> PreparedCommand<'a, Self, R>where
Self: Sized,
O: SingleArg,
N: PrimitiveResponse,
V: PrimitiveResponse,
R: KeyValueCollectionResponse<N, V>,
sourcefn ft_config_set<O, V>(
self,
option: O,
value: V
) -> PreparedCommand<'a, Self, ()>
fn ft_config_set<O, V>( self, option: O, value: V ) -> PreparedCommand<'a, Self, ()>
sourcefn ft_create<I, S>(
self,
index: I,
options: FtCreateOptions,
schema: S
) -> PreparedCommand<'a, Self, ()>
fn ft_create<I, S>( self, index: I, options: FtCreateOptions, schema: S ) -> PreparedCommand<'a, Self, ()>
sourcefn ft_cursor_del<I>(
self,
index: I,
cursor_id: u64
) -> PreparedCommand<'a, Self, ()>
fn ft_cursor_del<I>( self, index: I, cursor_id: u64 ) -> PreparedCommand<'a, Self, ()>
sourcefn ft_cursor_read<I>(
self,
index: I,
cursor_id: u64
) -> PreparedCommand<'a, Self, FtAggregateResult>
fn ft_cursor_read<I>( self, index: I, cursor_id: u64 ) -> PreparedCommand<'a, Self, FtAggregateResult>
Read next results from an existing cursor
§Arguments
index
- index name.cursor_id
- id of the cursor.read_size
- number of results to read. This parameter overridescount
specified inft_aggregate
.
§Returns
an instance of FtAggregateResult
§See Also
sourcefn ft_dictadd<D, T, TT>(
self,
dict: D,
terms: TT
) -> PreparedCommand<'a, Self, usize>
fn ft_dictadd<D, T, TT>( self, dict: D, terms: TT ) -> PreparedCommand<'a, Self, usize>
sourcefn ft_dictdel<D, T, TT>(
self,
dict: D,
terms: TT
) -> PreparedCommand<'a, Self, usize>
fn ft_dictdel<D, T, TT>( self, dict: D, terms: TT ) -> PreparedCommand<'a, Self, usize>
sourcefn ft_dictdump<D, T, TT>(self, dict: D) -> PreparedCommand<'a, Self, TT>where
Self: Sized,
D: SingleArg,
T: PrimitiveResponse + DeserializeOwned,
TT: CollectionResponse<T>,
fn ft_dictdump<D, T, TT>(self, dict: D) -> PreparedCommand<'a, Self, TT>where
Self: Sized,
D: SingleArg,
T: PrimitiveResponse + DeserializeOwned,
TT: CollectionResponse<T>,
sourcefn ft_dropindex<I>(self, index: I, dd: bool) -> PreparedCommand<'a, Self, ()>
fn ft_dropindex<I>(self, index: I, dd: bool) -> PreparedCommand<'a, Self, ()>
Delete an index
§Arguments
index
- full-text index name. You must first create the index usingft_create
.dd
- drop operation that, if set, deletes the actual document hashes
§Notes
- By default,
ft_dropindex
does not delete the document hashes associated with the index. Adding thedd
option deletes the hashes as well. - When using
ft_dropindex
with the parameterdd
, if an index creation is still running (ft_create
is running asynchronously), only the document hashes that have already been indexed are deleted. The document hashes left to be indexed remain in the database. You can useft_info
to check the completion of the indexing.
§Return
the number of new terms that were added.
§See Also
sourcefn ft_explain<I, Q, R>(
self,
index: I,
query: Q,
dialect_version: Option<u64>
) -> PreparedCommand<'a, Self, R>
fn ft_explain<I, Q, R>( self, index: I, query: Q, dialect_version: Option<u64> ) -> PreparedCommand<'a, Self, R>
Return the execution plan for a complex query
§Arguments
index
- full-text index name. You must first create the index usingft_create
.query
- query string, as if sent toft_search
.dialect_version
- dialect version under which to execute the query.
If not specified, the query executes under the default dialect version set during module initial loading
or viaft_config_set
command.
§Notes
- In the returned response, a
+
on a term is an indication of stemming. redis-cli --raw
to properly read line-breaks in the returned response.
§Return
a string representing the execution plan.
§See Also
sourcefn ft_explaincli<I, Q, R, RR>(
self,
index: I,
query: Q,
dialect_version: Option<u64>
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
I: SingleArg,
Q: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R>,
fn ft_explaincli<I, Q, R, RR>(
self,
index: I,
query: Q,
dialect_version: Option<u64>
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
I: SingleArg,
Q: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R>,
Return the execution plan for a complex query but formatted for easier reading without using redis-cli --raw
§Arguments
index
- full-text index name. You must first create the index usingft_create
.query
- query string, as if sent toft_search
.dialect_version
- dialect version under which to execute the query.
If not specified, the query executes under the default dialect version set during module initial loading
or viaft_config_set
command.
§Notes
- In the returned response, a
+
on a term is an indication of stemming.
§Return
a collection of strings representing the execution plan.
§See Also
sourcefn ft_info(
self,
index: impl SingleArg
) -> PreparedCommand<'a, Self, FtInfoResult>where
Self: Sized,
fn ft_info(
self,
index: impl SingleArg
) -> PreparedCommand<'a, Self, FtInfoResult>where
Self: Sized,
Return information and statistics on the index
§Arguments
index
- full-text index name. You must first create the index usingft_create
.
§Return
an instance of FtInfoResult
§See Also
sourcefn ft_list<R, RR>(self) -> PreparedCommand<'a, Self, RR>
fn ft_list<R, RR>(self) -> PreparedCommand<'a, Self, RR>
sourcefn ft_profile_search<I, Q, QQ>(
self,
index: I,
limited: bool,
query: QQ
) -> PreparedCommand<'a, Self, FtProfileSearchResult>
fn ft_profile_search<I, Q, QQ>( self, index: I, limited: bool, query: QQ ) -> PreparedCommand<'a, Self, FtProfileSearchResult>
Perform a ft_search
command and collects performance information
§Arguments
index
- index name. You must first create the index usingft_create
.limited
- if set, removes details of reader iterator.query
- collection of query parameters (non including the index name)
§Note
To reduce the size of the output, use nocontent
or limit(0,0)
to reduce results reply
or LIMITED
to not reply with details of reader iterators
inside builtin-unions such as fuzzy
or prefix
.
§Return
An instance of FtProfileSearchResult
§See Also
sourcefn ft_profile_aggregate<I, Q, QQ>(
self,
index: I,
limited: bool,
query: QQ
) -> PreparedCommand<'a, Self, FtProfileAggregateResult>
fn ft_profile_aggregate<I, Q, QQ>( self, index: I, limited: bool, query: QQ ) -> PreparedCommand<'a, Self, FtProfileAggregateResult>
Perform a ft_aggregate
command and collects performance information
§Arguments
index
- index name. You must first create the index usingft_create
.limited
- if set, removes details of reader iterator.query
- collection of query parameters (non including the index name)
§Note
To reduce the size of the output, use nocontent
or limit(0,0)
to reduce results reply
or LIMITED
to not reply with details of reader iterators
inside builtin-unions such as fuzzy
or prefix
.
§Return
An instance of FtProfileAggregateResult
§See Also
sourcefn ft_search<I, Q>(
self,
index: I,
query: Q,
options: FtSearchOptions
) -> PreparedCommand<'a, Self, FtSearchResult>
fn ft_search<I, Q>( self, index: I, query: Q, options: FtSearchOptions ) -> PreparedCommand<'a, Self, FtSearchResult>
Search the index with a textual query, returning either documents or just ids
§Arguments
index
- index name. You must first create the index usingft_create
.query
- text query to search. Refer toQuery syntax
for more details.options
- SeeFtSearchOptions
§Return
An instance of FtSearchResult
§See Also
sourcefn ft_spellcheck<I, Q>(
self,
index: I,
query: Q,
options: FtSpellCheckOptions
) -> PreparedCommand<'a, Self, FtSpellCheckResult>
fn ft_spellcheck<I, Q>( self, index: I, query: Q, options: FtSpellCheckOptions ) -> PreparedCommand<'a, Self, FtSpellCheckResult>
Perform spelling correction on a query, returning suggestions for misspelled terms
§Arguments
index
- index name. You must first create the index usingft_create
.query
- search query. SeeSpellchecking
for more details.options
- SeeFtSpellCheckOptions
§Return
An instance of FtSpellCheckResult
§See Also
sourcefn ft_syndump<I, R>(self, index: I) -> PreparedCommand<'a, Self, R>
fn ft_syndump<I, R>(self, index: I) -> PreparedCommand<'a, Self, R>
sourcefn ft_synupdate<T: SingleArg>(
self,
index: impl SingleArg,
synonym_group_id: impl SingleArg,
skip_initial_scan: bool,
terms: impl SingleArgCollection<T>
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
fn ft_synupdate<T: SingleArg>(
self,
index: impl SingleArg,
synonym_group_id: impl SingleArg,
skip_initial_scan: bool,
terms: impl SingleArgCollection<T>
) -> PreparedCommand<'a, Self, ()>where
Self: Sized,
Update a synonym group
Use this command to create or update a synonym group with additional terms. The command triggers a scan of all documents. ///
§Arguments
index
- index name. You must first create the index usingft_create
.synonym_group_id
- synonym group to return.skip_initial_scan
- does not scan and index, and only documents that are indexed after the update are affected.terms
- terms to add to the synonym group
§Return
This command returns a list of synonym terms and their synonym group ids.
§See Also
sourcefn ft_tagvals<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>(
self,
index: impl SingleArg,
field_name: impl SingleArg
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
fn ft_tagvals<R: PrimitiveResponse + DeserializeOwned, RR: CollectionResponse<R>>(
self,
index: impl SingleArg,
field_name: impl SingleArg
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
Return a distinct set of values indexed in a Tag field
Use this command if your tag indexes things like cities, categories, and so on.
§Arguments
index
- index name. You must first create the index usingft_create
.field_name
- name of a Tag file defined in the schema.
§Return
A coolection reply of all distinct tags in the tag index.
§See Also
sourcefn ft_sugadd(
self,
key: impl SingleArg,
string: impl SingleArg,
score: f64,
options: FtSugAddOptions
) -> PreparedCommand<'a, Self, usize>where
Self: Sized,
fn ft_sugadd(
self,
key: impl SingleArg,
string: impl SingleArg,
score: f64,
options: FtSugAddOptions
) -> PreparedCommand<'a, Self, usize>where
Self: Sized,
Add a suggestion string to an auto-complete suggestion dictionary
The auto-complete suggestion dictionary is disconnected from the index definitions and leaves creating and updating suggestions dictionaries to the user.
§Arguments
key
- suggestion dictionary key.string
- suggestion string to index.score
- floating point number of the suggestion string’s weight.options
- SeeFtSugAddOptions
§Return
the current size of the suggestion dictionary.
§See Also
sourcefn ft_sugdel(
self,
key: impl SingleArg,
string: impl SingleArg
) -> PreparedCommand<'a, Self, bool>where
Self: Sized,
fn ft_sugdel(
self,
key: impl SingleArg,
string: impl SingleArg
) -> PreparedCommand<'a, Self, bool>where
Self: Sized,
sourcefn ft_sugget(
self,
key: impl SingleArg,
prefix: impl SingleArg,
options: FtSugGetOptions
) -> PreparedCommand<'a, Self, Vec<FtSuggestion>>where
Self: Sized,
fn ft_sugget(
self,
key: impl SingleArg,
prefix: impl SingleArg,
options: FtSugGetOptions
) -> PreparedCommand<'a, Self, Vec<FtSuggestion>>where
Self: Sized,
Get completion suggestions for a prefix
§Arguments
key
- suggestion dictionary key.prefix
- prefix to complete on.options
- SeeFtSugGetOptions
§Return
A collection of the top suggestions matching the prefix