Package org.redisson.api
Interface RSearch
- All Superinterfaces:
RSearchAsync
- All Known Implementing Classes:
RedissonSearch
API for RediSearch module
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds alias to defined index namelong
Adds defined terms to the dictionaryaggregate
(String indexName, String query, AggregationOptions options) Executes aggregation over defined index using defined query.void
alter
(String indexName, boolean skipInitialScan, FieldIndex... fields) Adds a new attribute to the indexvoid
createIndex
(String indexName, IndexOptions options, FieldIndex... fields) Creates an index.void
Deletes index aliasvoid
Deletes cursor by index name and idlong
Deletes defined terms from the dictionaryvoid
Deletes index by namevoid
dropIndexAndDocuments
(String indexName) Deletes index by name and associated documentsReturns terms stored in the dictionarydumpSynonyms
(String indexName) Returns synonyms mapped by word by defined index nameReturns configuration map by defined parameter nameReturns index info by namereadCursor
(String indexName, long cursorId) Returns next results by index name and cursor idreadCursor
(String indexName, long cursorId, int count) Returns next results by index name, cursor id and results sizesearch
(String indexName, String query, QueryOptions options) Executes search over defined index using defined query.void
Sets configuration value by the parameter namespellcheck
(String indexName, String query, SpellcheckOptions options) Executes spell checking by defined index name and query.void
updateAlias
(String alias, String indexName) Adds alias to defined index name.void
updateSynonyms
(String indexName, String synonymGroupId, String... terms) Updates synonymsMethods inherited from interface org.redisson.api.RSearchAsync
addAliasAsync, addDictAsync, aggregateAsync, alterAsync, createIndexAsync, delAliasAsync, delCursorAsync, delDictAsync, dropIndexAndDocumentsAsync, dropIndexAsync, dumpDictAsync, dumpSynonymsAsync, getConfigAsync, infoAsync, readCursorAsync, readCursorAsync, searchAsync, setConfigAsync, spellcheckAsync, updateAliasAsync, updateSynonymsAsync
-
Method Details
-
createIndex
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
-
search
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
-
aggregate
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
-
addAlias
Adds alias to defined index name- Parameters:
alias
- alias valueindexName
- index name
-
delAlias
Deletes index alias- Parameters:
alias
- alias value
-
updateAlias
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
-
alter
Adds a new attribute to the index- Parameters:
indexName
- index nameskipInitialScan
- doesn't scan the index iftrue
fields
- field indexes
-
getConfig
Returns configuration map by defined parameter name- Parameters:
parameter
- parameter name- Returns:
- configuration map
-
setConfig
Sets configuration value by the parameter name- Parameters:
parameter
- parameter namevalue
- parameter value
-
delCursor
Deletes cursor by index name and id- Parameters:
indexName
- index namecursorId
- cursor id
-
readCursor
Returns next results by index name and cursor id- Parameters:
indexName
- index namecursorId
- cursor id- Returns:
- aggregation result
-
readCursor
Returns next results by index name, cursor id and results size- Parameters:
indexName
- index namecursorId
- cursor idcount
- results size- Returns:
- aggregation result
-
addDict
Adds defined terms to the dictionary- Parameters:
dictionary
- dictionary nameterms
- terms- Returns:
- number of new terms
-
delDict
Deletes defined terms from the dictionary- Parameters:
dictionary
- dictionary nameterms
- terms- Returns:
- number of deleted terms
-
dumpDict
Returns terms stored in the dictionary- Parameters:
dictionary
- dictionary name- Returns:
- terms
-
dropIndex
Deletes index by name- Parameters:
indexName
- index name
-
dropIndexAndDocuments
Deletes index by name and associated documents- Parameters:
indexName
- index name
-
info
Returns index info by name- Parameters:
indexName
- index name- Returns:
- index info
-
spellcheck
Map<String,Map<String, spellcheckDouble>> (String indexName, String query, SpellcheckOptions options) Executes spell checking by defined index name and query.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:
- result
-
dumpSynonyms
Returns synonyms mapped by word by defined index name- Parameters:
indexName
- index name- Returns:
- synonyms map
-
updateSynonyms
Updates synonyms- Parameters:
indexName
- index namesynonymGroupId
- synonym group idterms
- terms
-