org.elasticsearch.action.get
Class GetRequestBuilder

java.lang.Object
  extended by org.elasticsearch.action.support.BaseRequestBuilder<GetRequest,GetResponse>
      extended by org.elasticsearch.action.get.GetRequestBuilder
All Implemented Interfaces:
ActionRequestBuilder<GetRequest,GetResponse>

public class GetRequestBuilder
extends BaseRequestBuilder<GetRequest,GetResponse>

A get document action request builder.


Field Summary
 
Fields inherited from class org.elasticsearch.action.support.BaseRequestBuilder
client, request
 
Constructor Summary
GetRequestBuilder(Client client)
           
GetRequestBuilder(Client client, String index)
           
 
Method Summary
protected  void doExecute(ActionListener<GetResponse> listener)
           
 GetRequestBuilder setFields(String... fields)
          Explicitly specify the fields that will be returned.
 GetRequestBuilder setId(String id)
          Sets the id of the document to fetch.
 GetRequestBuilder setIndex(String index)
          Sets the index of the document to fetch.
 GetRequestBuilder setListenerThreaded(boolean threadedListener)
          Should the listener be called on a separate thread if needed.
 GetRequestBuilder setOperationThreaded(boolean threadedOperation)
          Controls if the operation will be executed on a separate thread when executed locally.
 GetRequestBuilder setParent(String parent)
          Sets the parent id of this document.
 GetRequestBuilder setPreference(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(String routing)
          Controls the shard routing of the request.
 GetRequestBuilder setType(String type)
          Sets the type of the document to fetch.
 
Methods inherited from class org.elasticsearch.action.support.BaseRequestBuilder
execute, execute, request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetRequestBuilder

public GetRequestBuilder(Client client)

GetRequestBuilder

public GetRequestBuilder(Client client,
                         @Nullable
                         String index)
Method Detail

setIndex

public GetRequestBuilder setIndex(String index)
Sets the index of the document to fetch.


setType

public GetRequestBuilder setType(@Nullable
                                 String type)
Sets the type of the document to fetch. If set to null, will use just the id to fetch the first document matching it.


setId

public GetRequestBuilder setId(String id)
Sets the id of the document to fetch.


setParent

public GetRequestBuilder setParent(String parent)
Sets the parent id of this document. Will simply set the routing to this value, as it is only used for routing with delete requests.


setRouting

public GetRequestBuilder setRouting(String routing)
Controls the shard routing of the request. Using this value to hash the shard and not the id.


setPreference

public GetRequestBuilder setPreference(String preference)
Sets the preference to execute the search. Defaults to randomize across shards. Can be set to _local to prefer local shards, _primary to execute only on primary shards, or a custom value, which guarantees that the same order will be used across different requests.


setFields

public GetRequestBuilder setFields(String... fields)
Explicitly specify the fields that will be returned. By default, the _source field will be returned.


setRefresh

public GetRequestBuilder setRefresh(boolean refresh)
Should a refresh be executed before this get operation causing the operation to return the latest value. Note, heavy get should not set this to true. Defaults to false.


setRealtime

public GetRequestBuilder setRealtime(Boolean realtime)

setListenerThreaded

public GetRequestBuilder setListenerThreaded(boolean threadedListener)
Should the listener be called on a separate thread if needed.


setOperationThreaded

public GetRequestBuilder setOperationThreaded(boolean threadedOperation)
Controls if the operation will be executed on a separate thread when executed locally.


doExecute

protected void doExecute(ActionListener<GetResponse> listener)
Specified by:
doExecute in class BaseRequestBuilder<GetRequest,GetResponse>


Copyright © 2009-2012. All Rights Reserved.