org.elasticsearch.action.percolate
Class PercolateRequestBuilder

java.lang.Object
  extended by org.elasticsearch.action.support.BaseRequestBuilder<PercolateRequest,PercolateResponse>
      extended by org.elasticsearch.action.percolate.PercolateRequestBuilder
All Implemented Interfaces:
ActionRequestBuilder<PercolateRequest,PercolateResponse>

public class PercolateRequestBuilder
extends BaseRequestBuilder<PercolateRequest,PercolateResponse>


Field Summary
 
Fields inherited from class org.elasticsearch.action.support.BaseRequestBuilder
client, request
 
Constructor Summary
PercolateRequestBuilder(Client client)
           
PercolateRequestBuilder(Client client, String index, String type)
           
 
Method Summary
protected  void doExecute(ActionListener<PercolateResponse> listener)
           
 PercolateRequestBuilder setIndex(String index)
          Sets the index to percolate the document against.
 PercolateRequestBuilder setListenerThreaded(boolean listenerThreaded)
          Should the listener be called on a separate thread if needed.
 PercolateRequestBuilder setOperationThreaded(boolean operationThreaded)
          Controls if the operation will be executed on a separate thread when executed locally.
 PercolateRequestBuilder setPreferLocal(boolean preferLocal)
          if this operation hits a node with a local relevant shard, should it be preferred to be executed on, or just do plain round robin.
 PercolateRequestBuilder setSource(byte[] source)
          Sets the document to index in bytes form.
 PercolateRequestBuilder setSource(byte[] source, int offset, int length)
          Sets the document to index in bytes form (assumed to be safe to be used from different threads).
 PercolateRequestBuilder setSource(byte[] source, int offset, int length, boolean unsafe)
          Sets the document to index in bytes form.
 PercolateRequestBuilder setSource(BytesReference source)
          Sets the document to index in bytes form.
 PercolateRequestBuilder setSource(BytesReference source, boolean unsafe)
          Sets the document to index in bytes form.
 PercolateRequestBuilder setSource(Map<String,Object> source)
          Index the Map as a JSON.
 PercolateRequestBuilder setSource(Map<String,Object> source, XContentType contentType)
          Index the Map as the provided content type.
 PercolateRequestBuilder setSource(String source)
          Sets the document source to index.
 PercolateRequestBuilder setSource(XContentBuilder sourceBuilder)
          Sets the content source to index.
 PercolateRequestBuilder setType(String type)
          Sets the type of the document to percolate.
 
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

PercolateRequestBuilder

public PercolateRequestBuilder(Client client)

PercolateRequestBuilder

public PercolateRequestBuilder(Client client,
                               String index,
                               String type)
Method Detail

setIndex

public PercolateRequestBuilder setIndex(String index)
Sets the index to percolate the document against.


setType

public PercolateRequestBuilder setType(String type)
Sets the type of the document to percolate.


setSource

public PercolateRequestBuilder setSource(Map<String,Object> source)
Index the Map as a JSON.

Parameters:
source - The map to index

setSource

public PercolateRequestBuilder setSource(Map<String,Object> source,
                                         XContentType contentType)
Index the Map as the provided content type.

Parameters:
source - The map to index

setSource

public PercolateRequestBuilder setSource(String source)
Sets the document source to index.

Note, its preferable to either set it using setSource(org.elasticsearch.common.xcontent.XContentBuilder) or using the setSource(byte[]).


setSource

public PercolateRequestBuilder setSource(XContentBuilder sourceBuilder)
Sets the content source to index.


setSource

public PercolateRequestBuilder setSource(BytesReference source)
Sets the document to index in bytes form.


setSource

public PercolateRequestBuilder setSource(BytesReference source,
                                         boolean unsafe)
Sets the document to index in bytes form.


setSource

public PercolateRequestBuilder setSource(byte[] source)
Sets the document to index in bytes form.


setSource

public PercolateRequestBuilder setSource(byte[] source,
                                         int offset,
                                         int length)
Sets the document to index in bytes form (assumed to be safe to be used from different threads).

Parameters:
source - The source to index
offset - The offset in the byte array
length - The length of the data

setSource

public PercolateRequestBuilder setSource(byte[] source,
                                         int offset,
                                         int length,
                                         boolean unsafe)
Sets the document to index in bytes form.

Parameters:
source - The source to index
offset - The offset in the byte array
length - The length of the data
unsafe - Is the byte array safe to be used form a different thread

setListenerThreaded

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


setPreferLocal

public PercolateRequestBuilder setPreferLocal(boolean preferLocal)
if this operation hits a node with a local relevant shard, should it be preferred to be executed on, or just do plain round robin. Defaults to true


setOperationThreaded

public PercolateRequestBuilder setOperationThreaded(boolean operationThreaded)
Controls if the operation will be executed on a separate thread when executed locally. Defaults to true when running in embedded mode.


doExecute

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


Copyright © 2009-2012. All Rights Reserved.