public abstract static class SecondaryIndexQuery.Init<S,T extends SecondaryIndexQuery.Init<S,T>> extends Object
Constructor and Description |
---|
Init(Namespace namespace,
String indexName,
byte[] coverageContext)
Build a cover query.
|
Init(Namespace namespace,
String indexName,
S match)
Build a match query.
|
Init(Namespace namespace,
String indexName,
S start,
S end)
Build a range query.
|
Modifier and Type | Method and Description |
---|---|
protected abstract T |
self() |
T |
withContinuation(BinaryValue continuation)
Set the continuation for this query.
|
T |
withCoverageContext(byte[] coverageContext)
Set the cover context for the local read
|
T |
withKeyAndIndex(boolean returnBoth)
Set whether to return the index keys with the Riak object keys.
|
T |
withMaxResults(Integer maxResults)
Set the maximum number of results returned by the query.
|
T |
withPaginationSort(boolean orderByKey)
Set whether to sort the results of a non-paginated 2i query.
|
T |
withRegexTermFilter(String filter)
Set the regex to filter result terms by for this query.
|
protected T |
withReturnBody(boolean returnBody)
Set whether to return the object values with the Riak object keys.
|
T |
withTimeout(int timeout)
Set the Riak-side timeout value.
|
public Init(Namespace namespace, String indexName, S start, S end)
Returns all objects in Riak that have an index value in the specified range.
namespace
- the namespace for this query.indexName
- the indexnamestart
- the start index valueend
- the end index valuepublic Init(Namespace namespace, String indexName, S match)
Returns all objects in Riak that have an index value matching the one supplied.
namespace
- the namespace for this queryindexName
- the index namematch
- the index value.public Init(Namespace namespace, String indexName, byte[] coverageContext)
Returns all objects in Riak related to the provided coverageContext.
namespace
- the namespace for this queryindexName
- the index namecoverageContext
- the cover context. An opaque binary received from coverage context entry
to be sent back to Riak for receiving appropriate data.protected abstract T self()
public T withContinuation(BinaryValue continuation)
The continuation is returned by a previous paginated query.
continuation
- public T withMaxResults(Integer maxResults)
maxResults
- the number of results.public T withKeyAndIndex(boolean returnBoth)
returnBoth
- true to return both index and object keys, false to return only object keys.public T withPaginationSort(boolean orderByKey)
Setting this to true will sort the results in Riak before returning them.
Note that this is not recommended for queries that could return a large result set; the overhead in Riak is substantial.
orderByKey
- true to sort the results, false to return as-is.public T withRegexTermFilter(String filter)
filter
- the regex to filter terms by.public T withTimeout(int timeout)
By default, riak has a 60s timeout for operations. Setting this value will override that default for both the fetch and store operation.
timeout
- the timeout in millisecondspublic T withCoverageContext(byte[] coverageContext)
coverageContext
- the cover context. An opaque binary received from coverage context entry
to be sent back to Riak for receiving appropriate data.protected T withReturnBody(boolean returnBody)
returnBody
- Copyright © 2016. All rights reserved.