public interface Client extends Closeable
Modifier and Type | Field and Description |
---|---|
static String |
DELETE_DOCUMENT
Deprecated.
use
Keywords.DD instead |
static String |
FUZZY_FLAG
Deprecated.
use
Keywords.FUZZY instead |
static String |
INCREMENT_FLAG
Deprecated.
use
Keywords.INCR instead |
static String |
MAX_FLAG
Deprecated.
use
Keywords.MAX instead |
static String |
PAYLOAD_FLAG
Deprecated.
use
Keywords.PAYLOAD instead |
Modifier and Type | Method and Description |
---|---|
boolean |
addAlias(String name)
Add an alias to the index.
|
boolean |
addDocument(Document doc)
Add a document to the index
|
boolean |
addDocument(Document doc,
AddOptions options)
Add a document to the index
|
boolean |
addDocument(String docId,
double score,
Map<String,Object> fields)
|
boolean |
addDocument(String docId,
double score,
Map<String,Object> fields,
boolean noSave,
boolean replace,
byte[] payload)
Add a single document to the query
|
boolean |
addDocument(String docId,
Map<String,Object> fields)
|
boolean[] |
addDocuments(AddOptions options,
Document... docs)
Add a batch of documents to the index
|
boolean[] |
addDocuments(Document... docs)
Add a document to the index
|
boolean |
addHash(String docId,
double score,
boolean replace)
Deprecated.
not supported since RediSeach 2 use
BinaryJedis.hset(byte[], Map) instead |
Long |
addSuggestion(Suggestion suggestion,
boolean increment)
Add a word to the suggestion index for redis plugin
|
long |
addSynonym(String... terms)
Deprecated.
not supported since RediSeach 2 use {@link #updateSynonym(String, String...) instead
|
AggregationResult |
aggregate(AggregationBuilder q)
Search and Aggregate the index
|
AggregationResult |
aggregate(AggregationRequest q)
Deprecated.
use
aggregate(AggregationBuilder) instead |
boolean |
alterIndex(Schema.Field... fields)
Alter index add fields
|
redis.clients.jedis.Jedis |
connection() |
boolean |
createIndex(Schema schema,
Client.IndexOptions options)
Create the index definition in redis
|
boolean |
cursorDelete(long cursorId)
Delete a cursor from the index.
|
AggregationResult |
cursorRead(long cursorId,
int count)
Read from an existing cursor
|
boolean |
deleteAlias(String name)
remove an alias from an index.
|
boolean |
deleteDocument(String docId)
Delete a document from the index (doesn't delete the document).
|
boolean |
deleteDocument(String docId,
boolean deleteDocument)
Delete a document from the index.
|
boolean[] |
deleteDocuments(boolean deleteDocuments,
String... docIds)
Delete a documents from the index
|
Long |
deleteSuggestion(String entry)
Deletes a string from a suggestion
|
boolean |
dropIndex()
Drop the index and all associated keys, including documents
|
boolean |
dropIndex(boolean missingOk)
Drop the index and all associated keys, including documents
|
Map<String,List<String>> |
dumpSynonym() |
String |
explain(Query q)
Generate an explanatory textual query tree for this query string
|
Map<String,String> |
getAllConfig()
Get all configuration options, consisting of the option's name and current value
|
String |
getConfig(ConfigOption option)
Get runtime configuration option value
|
Document |
getDocument(String docId)
Get a document from the index
|
Document |
getDocument(String docId,
boolean decode)
Get a document from the index
|
List<Document> |
getDocuments(boolean decode,
String... docIds)
Get a documents from the index
|
List<Document> |
getDocuments(String... docIds)
Get a document from the index
|
Map<String,Object> |
getInfo()
Get the index info, including memory consumption and other statistics.
|
List<Suggestion> |
getSuggestion(String prefix,
SuggestionOptions suggestionOptions)
Request the Suggestions based on the prefix
|
Long |
getSuggestionLength()
Gets the size of an auto-complete suggestion
|
boolean |
replaceDocument(String docId,
double score,
Map<String,Object> fields)
replaceDocument is a convenience for calling addDocument with replace=true
|
boolean |
replaceDocument(String docId,
double score,
Map<String,Object> fields,
String filter)
replaceDocument is a convenience for calling addDocument with replace=true
|
SearchResult |
search(Query q)
Search the index
|
SearchResult |
search(Query q,
boolean decode)
Search the index
|
SearchResult[] |
searchBatch(Query... queries)
Batch search the index
|
boolean |
setConfig(ConfigOption option,
String value)
Set runtime configuration option
|
boolean |
updateAlias(String name)
Update an alias from an index.
|
boolean |
updateDocument(String docId,
double score,
Map<String,Object> fields)
Replace specific fields in a document.
|
boolean |
updateDocument(String docId,
double score,
Map<String,Object> fields,
String filter)
Replace specific fields in a document.
|
boolean |
updateSynonym(long synonymGroupId,
String... terms)
Deprecated.
use {@link #updateSynonym(String, String...) instead
|
boolean |
updateSynonym(String synonymGroupId,
String... terms)
Updates a synonym group.
|
@Deprecated static final String INCREMENT_FLAG
Keywords.INCR
instead@Deprecated static final String PAYLOAD_FLAG
Keywords.PAYLOAD
instead@Deprecated static final String MAX_FLAG
Keywords.MAX
instead@Deprecated static final String FUZZY_FLAG
Keywords.FUZZY
instead@Deprecated static final String DELETE_DOCUMENT
Keywords.DD
insteadboolean createIndex(Schema schema, Client.IndexOptions options)
schema
- a schema definition, see Schema
options
- index option flags, see Client.IndexOptions
SearchResult search(Query q)
q
- a Query
object with the query string and optional parametersSearchResult
object with the resultsSearchResult[] searchBatch(Query... queries)
queries
- batch of Query
objects with the query strings and optional parametersSearchResult
batch with the resultsSearchResult search(Query q, boolean decode)
q
- a Query
object with the query string and optional parametersdecode
- false
- keeps the fields value as byte[]SearchResult
object with the results@Deprecated AggregationResult aggregate(AggregationRequest q)
aggregate(AggregationBuilder)
insteadAggregationResult aggregate(AggregationBuilder q)
q
- a AggregationBuilder
object with the query string and optional aggregation parametersAggregationResult
object with the resultsboolean cursorDelete(long cursorId)
cursorId
- the cursor's idAggregationResult cursorRead(long cursorId, int count)
cursorId
- the cursor's idcount
- limit the amount of returned resultsAggregationResult
object with the resultsString explain(Query q)
q
- The query to explainboolean addDocument(Document doc, AddOptions options)
doc
- The document to addoptions
- Options for the operationboolean addDocument(String docId, double score, Map<String,Object> fields, boolean noSave, boolean replace, byte[] payload)
docId
- the id of the document. It cannot belong to a document already in the index unless replace is setscore
- the document's score, floating point number between 0 and 1fields
- a map of the document's fieldsnoSave
- if set, we only index the document and do not save its contents. This allows fetching just doc idsreplace
- if set, and the document already exists, we reindex and update itpayload
- if set, we can save a payload in the index to be retrieved or evaluated by scoring functions on the serverboolean addDocument(Document doc)
doc
- The document to addboolean[] addDocuments(Document... docs)
docs
- The document to addboolean[] addDocuments(AddOptions options, Document... docs)
options
- Options for the operationdocs
- The documents to addboolean replaceDocument(String docId, double score, Map<String,Object> fields)
docId
- score
- fields
- boolean replaceDocument(String docId, double score, Map<String,Object> fields, String filter)
docId
- score
- fields
- filter
- updates the document only if a boolean expression applies to the documentboolean updateDocument(String docId, double score, Map<String,Object> fields)
docId
- the id of the document. It cannot belong to a document already in the index unless replace is setscore
- the document's score, floating point number between 0 and 1fields
- a map of the document's fieldsboolean updateDocument(String docId, double score, Map<String,Object> fields, String filter)
docId
- the id of the document. It cannot belong to a document already in the index unless replace is setscore
- the document's score, floating point number between 0 and 1fields
- a map of the document's fieldsfilter
- updates the document only if a boolean expression applies to the document@Deprecated boolean addHash(String docId, double score, boolean replace)
BinaryJedis.hset(byte[], Map)
insteaddocId
- the id of the document in redis. This must match an existing, unindexed HASH keyscore
- the document's index score, between 0 and 1replace
- if set, and the document already exists, we reindex and update itMap<String,Object> getInfo()
boolean deleteDocument(String docId)
docId
- the document's iddeleteDocument(String, boolean)
boolean[] deleteDocuments(boolean deleteDocuments, String... docIds)
deleteDocuments
- if true
also deletes the actual document ifs it is in the indexdocIds
- the document's idsboolean deleteDocument(String docId, boolean deleteDocument)
docId
- the document's iddeleteDocument
- if true
also deletes the actual document if it is in the indexDocument getDocument(String docId)
docId
- The document ID to retrieveString
getDocument(String, boolean)
Document getDocument(String docId, boolean decode)
docId
- The document ID to retrievedecode
- false
- keeps the fields value as byte[]List<Document> getDocuments(String... docIds)
docIds
- The document IDs to retrieveList<Document> getDocuments(boolean decode, String... docIds)
decode
- false
- keeps the fields value as byte[]docIds
- The document IDs to retrieveboolean dropIndex()
boolean dropIndex(boolean missingOk)
Long addSuggestion(Suggestion suggestion, boolean increment)
suggestion
- the Suggestion to be addedincrement
- if we should increment this suggestion or notList<Suggestion> getSuggestion(String prefix, SuggestionOptions suggestionOptions)
prefix
- the partial wordsuggestionOptions
- the options on what you need returned and other usageLong deleteSuggestion(String entry)
Long getSuggestionLength()
boolean alterIndex(Schema.Field... fields)
fields
- list of fieldsboolean setConfig(ConfigOption option, String value)
option
- the name of the configuration optionvalue
- a value for the configuration optionString getConfig(ConfigOption option)
option
- the name of the configuration optionMap<String,String> getAllConfig()
boolean addAlias(String name)
name
- boolean updateAlias(String name)
name
- boolean deleteAlias(String name)
name
- @Deprecated long addSynonym(String... terms)
terms
- @Deprecated boolean updateSynonym(long synonymGroupId, String... terms)
synonymGroupId
- terms
- boolean updateSynonym(String synonymGroupId, String... terms)
synonymGroupId
- terms
- Map<String,List<String>> dumpSynonym()
redis.clients.jedis.Jedis connection()
Copyright © 2020 RedisLabs. All rights reserved.