Package org.redisson.api
Interface RSearchAsync
- All Known Subinterfaces:
RSearch
- All Known Implementing Classes:
RedissonSearch
public interface RSearchAsync
Asynchronous API for RediSearch module
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionaddAliasAsync
(String alias, String indexName) Adds alias to defined index nameaddDictAsync
(String dictionary, String... terms) Adds defined terms to the dictionaryaggregateAsync
(String indexName, String query, AggregationOptions options) Executes aggregation over defined index using defined query.alterAsync
(String indexName, boolean skipInitialScan, FieldIndex... fields) Adds a new attribute to the indexcreateIndexAsync
(String indexName, IndexOptions options, FieldIndex... fields) Creates an index.delAliasAsync
(String alias) Deletes index aliasdelCursorAsync
(String indexName, long cursorId) Deletes cursor by index name and iddelDictAsync
(String dictionary, String... terms) Deletes defined terms from the dictionarydropIndexAndDocumentsAsync
(String indexName) Deletes index by name and associated documentsdropIndexAsync
(String indexName) Deletes index by name and associated documents.dumpDictAsync
(String dictionary) Returns terms stored in the dictionarydumpSynonymsAsync
(String indexName) Returns synonyms mapped by word by defined index namegetConfigAsync
(String parameter) Returns configuration map by defined parameter nameReturns list of all created indexesReturns index info by namereadCursorAsync
(String indexName, long cursorId) Returns next results by index name and cursor idreadCursorAsync
(String indexName, long cursorId, int count) Returns next results by index name, cursor id and results sizesearchAsync
(String indexName, String query, QueryOptions options) Executes search over defined index using defined query.setConfigAsync
(String parameter, String value) Sets configuration value by the parameter namespellcheckAsync
(String indexName, String query, SpellcheckOptions options) Executes spell checking by defined index name and query.updateAliasAsync
(String alias, String indexName) Adds alias to defined index name.updateSynonymsAsync
(String indexName, String synonymGroupId, String... terms) Updates synonyms
-
Method Details
-
createIndexAsync
Creates an index.Code example:
search.create("idx", IndexOptions.defaults() .on(IndexType.HASH) .prefix(Arrays.asList("doc:")), FieldIndex.text("t1"), FieldIndex.tag("t2").withSuffixTrie());
- Parameters:
indexName
- index nameoptions
- index optionsfields
- fields
-
searchAsync
Executes search over defined index using defined query.Code example:
SearchResult r = s.search("idx", "*", QueryOptions.defaults() .returnAttributes(new ReturnAttribute("t1"), new ReturnAttribute("t2")));
- Parameters:
indexName
- index namequery
- query valueoptions
- query options- Returns:
- search result
-
aggregateAsync
RFuture<AggregationResult> aggregateAsync(String indexName, String query, AggregationOptions options) Executes aggregation over defined index using defined query.Code example:
AggregationResult r = s.aggregate("idx", "*", AggregationOptions.defaults() .load("t1", "t2"));
- Parameters:
indexName
- index namequery
- query valueoptions
- aggregation options- Returns:
- aggregation result
-
addAliasAsync
Adds alias to defined index name- Parameters:
alias
- alias valueindexName
- index name
-
delAliasAsync
Deletes index alias- Parameters:
alias
- alias value
-
updateAliasAsync
Adds alias to defined index name. Re-assigns the alias if it was used before with a different index.- Parameters:
alias
- alias valueindexName
- index name
-
alterAsync
Adds a new attribute to the index- Parameters:
indexName
- index nameskipInitialScan
- doesn't scan the index iftrue
fields
- field indexes
-
getConfigAsync
Returns configuration map by defined parameter name- Parameters:
parameter
- parameter name- Returns:
- configuration map
-
setConfigAsync
Sets configuration value by the parameter name- Parameters:
parameter
- parameter namevalue
- parameter value
-
delCursorAsync
Deletes cursor by index name and id- Parameters:
indexName
- index namecursorId
- cursor id
-
readCursorAsync
Returns next results by index name and cursor id- Parameters:
indexName
- index namecursorId
- cursor id- Returns:
- aggregation result
-
readCursorAsync
Returns next results by index name, cursor id and results size- Parameters:
indexName
- index namecursorId
- cursor idcount
- results size- Returns:
- aggregation result
-
addDictAsync
Adds defined terms to the dictionary- Parameters:
dictionary
- dictionary nameterms
- terms- Returns:
- number of new terms
-
delDictAsync
Deletes defined terms from the dictionary- Parameters:
dictionary
- dictionary nameterms
- terms- Returns:
- number of deleted terms
-
dumpDictAsync
Returns terms stored in the dictionary- Parameters:
dictionary
- dictionary name- Returns:
- terms
-
dropIndexAsync
Deletes index by name and associated documents. Associated documents are deleted asynchronously. MethodinfoAsync(String)
can be used to check for process completion.- Parameters:
indexName
- index name
-
dropIndexAndDocumentsAsync
Deletes index by name and associated documents- Parameters:
indexName
- index name
-
infoAsync
Returns index info by name- Parameters:
indexName
- index name- Returns:
- index info
-
spellcheckAsync
RFuture<Map<String,Map<String, spellcheckAsyncDouble>>> (String indexName, String query, SpellcheckOptions options) Executes spell checking by defined index name and query. Returns a map of misspelled terms and their score.Mapinvalid input: '<'String, Mapinvalid input: '<'String, Double>> res = s.spellcheck("idx", "Hocke sti", SpellcheckOptions.defaults() .includedTerms("name"));
- Parameters:
indexName
- index namequery
- queryoptions
- spell checking options- Returns:
- map of misspelled terms and their score
-
dumpSynonymsAsync
Returns synonyms mapped by word by defined index name- Parameters:
indexName
- index name- Returns:
- synonyms map
-
updateSynonymsAsync
Updates synonyms- Parameters:
indexName
- index namesynonymGroupId
- synonym group idterms
- terms
-
getIndexesAsync
Returns list of all created indexes- Returns:
- list of indexes
-