public class CollectionSearchResource
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected OrchestrateClient |
client
The Orchestrate client to make requests with.
|
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper
The object mapper used to deserialize JSON responses.
|
| Modifier and Type | Method and Description |
|---|---|
<T> OrchestrateRequest<SearchResults<T>> |
get(java.lang.Class<T> clazz,
java.lang.String luceneQuery)
Retrieve data from the Orchestrate service.
|
CollectionSearchResource |
limit(int limit)
The number of search results to get in this query, this value cannot
exceed 100.
|
CollectionSearchResource |
offset(int offset)
The position in the results list to start retrieving results from,
this is useful for paginating results.
|
protected <T> T |
toDomainObject(java.lang.String rawValue,
java.lang.Class<T> clazz) |
protected byte[] |
toJsonBytes(java.lang.Object value) |
protected com.fasterxml.jackson.databind.JsonNode |
toJsonNode(org.glassfish.grizzly.http.HttpContent response) |
protected <T> KvObject<T> |
toKvObject(org.glassfish.grizzly.http.HttpContent response,
java.lang.String collection,
java.lang.String key,
java.lang.Class<T> clazz) |
protected <T> KvObject<T> |
toKvObject(com.fasterxml.jackson.databind.JsonNode result,
java.lang.Class<T> clazz) |
CollectionSearchResource |
withValues(boolean withValues)
If
withValues is true then the KV objects in the search
results will be retrieved with their values. |
protected final OrchestrateClient client
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
public <T> OrchestrateRequest<SearchResults<T>> get(java.lang.Class<T> clazz, java.lang.String luceneQuery)
Usage:
String luceneQuery = "*";
SearchResults<String> results1 =
client.searchCollection("someCollection")
.limit(10)
.offset(0)
.get(String.class, luceneQuery)
.get();
T - The type toclazz - Type information for marshalling objects at runtime.luceneQuery - The lucene search query.public CollectionSearchResource limit(int limit)
limit - The number of search results in this query.public CollectionSearchResource offset(int offset)
offset - The position to start retrieving results from.public CollectionSearchResource withValues(boolean withValues)
withValues is true then the KV objects in the search
results will be retrieved with their values. Defaults to true.withValues - The setting for whether to retrieve KV values.protected byte[] toJsonBytes(java.lang.Object value)
protected com.fasterxml.jackson.databind.JsonNode toJsonNode(org.glassfish.grizzly.http.HttpContent response)
throws java.io.IOException
java.io.IOExceptionprotected <T> KvObject<T> toKvObject(com.fasterxml.jackson.databind.JsonNode result, java.lang.Class<T> clazz) throws java.io.IOException
java.io.IOExceptionprotected <T> KvObject<T> toKvObject(org.glassfish.grizzly.http.HttpContent response, java.lang.String collection, java.lang.String key, java.lang.Class<T> clazz) throws java.io.IOException
java.io.IOExceptionprotected <T> T toDomainObject(java.lang.String rawValue,
java.lang.Class<T> clazz)
throws java.io.IOException
java.io.IOException