public class GetRequestBuilder extends SingleShardOperationRequestBuilder<GetRequest,GetResponse,GetRequestBuilder>
action, client, request
Constructor and Description |
---|
GetRequestBuilder(ElasticsearchClient client,
GetAction action) |
GetRequestBuilder(ElasticsearchClient client,
GetAction action,
java.lang.String index) |
Modifier and Type | Method and Description |
---|---|
GetRequestBuilder |
setFetchSource(boolean fetch)
Indicates whether the response should contain the stored _source.
|
GetRequestBuilder |
setFetchSource(java.lang.String[] includes,
java.lang.String[] excludes)
Indicate that _source should be returned, with an "include" and/or "exclude" set which can include simple wildcard
elements.
|
GetRequestBuilder |
setFetchSource(java.lang.String include,
java.lang.String exclude)
Indicate that _source should be returned, with an "include" and/or "exclude" set which can include simple wildcard
elements.
|
GetRequestBuilder |
setId(java.lang.String id)
Sets the id of the document to fetch.
|
GetRequestBuilder |
setParent(java.lang.String parent)
Sets the parent id of this document.
|
GetRequestBuilder |
setPreference(java.lang.String preference)
Sets the preference to execute the search.
|
GetRequestBuilder |
setRealtime(boolean realtime) |
GetRequestBuilder |
setRefresh(boolean refresh)
Should a refresh be executed before this get operation causing the operation to
return the latest value.
|
GetRequestBuilder |
setRouting(java.lang.String routing)
Controls the shard routing of the request.
|
GetRequestBuilder |
setStoredFields(java.lang.String... fields)
Explicitly specify the fields that will be returned.
|
GetRequestBuilder |
setType(java.lang.String type)
Sets the type of the document to fetch.
|
GetRequestBuilder |
setVersion(long version)
Sets the version, which will cause the get operation to only be performed if a matching
version exists and no changes happened on the doc since then.
|
GetRequestBuilder |
setVersionType(VersionType versionType)
Sets the versioning type.
|
setIndex, setOperationThreaded
beforeExecute, execute, execute, get, get, get, request
public GetRequestBuilder(ElasticsearchClient client, GetAction action)
public GetRequestBuilder(ElasticsearchClient client, GetAction action, @Nullable java.lang.String index)
public GetRequestBuilder setType(@Nullable java.lang.String type)
public GetRequestBuilder setId(java.lang.String id)
public GetRequestBuilder setParent(java.lang.String parent)
public GetRequestBuilder setRouting(java.lang.String routing)
public GetRequestBuilder setPreference(java.lang.String preference)
public GetRequestBuilder setStoredFields(java.lang.String... fields)
public GetRequestBuilder setFetchSource(boolean fetch)
public GetRequestBuilder setFetchSource(@Nullable java.lang.String include, @Nullable java.lang.String exclude)
include
- An optional include (optionally wildcarded) pattern to filter the returned _sourceexclude
- An optional exclude (optionally wildcarded) pattern to filter the returned _sourcepublic GetRequestBuilder setFetchSource(@Nullable java.lang.String[] includes, @Nullable java.lang.String[] excludes)
includes
- An optional list of include (optionally wildcarded) pattern to filter the returned _sourceexcludes
- An optional list of exclude (optionally wildcarded) pattern to filter the returned _sourcepublic GetRequestBuilder setRefresh(boolean refresh)
public GetRequestBuilder setRealtime(boolean realtime)
public GetRequestBuilder setVersion(long version)
public GetRequestBuilder setVersionType(VersionType versionType)
VersionType.INTERNAL
.