org.elasticsearch.client.support
Class AbstractClient

java.lang.Object
  extended by org.elasticsearch.client.support.AbstractClient
All Implemented Interfaces:
Client, InternalClient
Direct Known Subclasses:
InternalTransportClient, NodeClient, TransportClient

public abstract class AbstractClient
extends Object
implements InternalClient


Constructor Summary
AbstractClient()
           
 
Method Summary
 ActionFuture<BulkResponse> bulk(BulkRequest request)
          Executes a bulk of index / delete operations.
 void bulk(BulkRequest request, ActionListener<BulkResponse> listener)
          Executes a bulk of index / delete operations.
 ActionFuture<CountResponse> count(CountRequest request)
          A count of all the documents matching a specific query.
 void count(CountRequest request, ActionListener<CountResponse> listener)
          A count of all the documents matching a specific query.
 ActionFuture<DeleteResponse> delete(DeleteRequest request)
          Deletes a document from the index based on the index, type and id.
 void delete(DeleteRequest request, ActionListener<DeleteResponse> listener)
          Deletes a document from the index based on the index, type and id.
 ActionFuture<DeleteByQueryResponse> deleteByQuery(DeleteByQueryRequest request)
          Deletes all documents from one or more indices based on a query.
 void deleteByQuery(DeleteByQueryRequest request, ActionListener<DeleteByQueryResponse> listener)
          Deletes all documents from one or more indices based on a query.
 ActionFuture<ExplainResponse> explain(ExplainRequest request)
          Computes a score explanation for the specified request.
 void explain(ExplainRequest request, ActionListener<ExplainResponse> listener)
          Computes a score explanation for the specified request.
 ActionFuture<GetResponse> get(GetRequest request)
          Gets the document that was indexed from an index with a type and id.
 void get(GetRequest request, ActionListener<GetResponse> listener)
          Gets the document that was indexed from an index with a type and id.
 ActionFuture<IndexResponse> index(IndexRequest request)
          Index a JSON source associated with a given index and type.
 void index(IndexRequest request, ActionListener<IndexResponse> listener)
          Index a document associated with a given index and type.
 ActionFuture<SearchResponse> moreLikeThis(MoreLikeThisRequest request)
          A more like this action to search for documents that are "like" a specific document.
 void moreLikeThis(MoreLikeThisRequest request, ActionListener<SearchResponse> listener)
          A more like this action to search for documents that are "like" a specific document.
 ActionFuture<MultiGetResponse> multiGet(MultiGetRequest request)
          Multi get documents.
 void multiGet(MultiGetRequest request, ActionListener<MultiGetResponse> listener)
          Multi get documents.
 ActionFuture<MultiSearchResponse> multiSearch(MultiSearchRequest request)
          Performs multiple search requests.
 void multiSearch(MultiSearchRequest request, ActionListener<MultiSearchResponse> listener)
          Performs multiple search requests.
 ActionFuture<PercolateResponse> percolate(PercolateRequest request)
          Percolates a request returning the matches documents.
 void percolate(PercolateRequest request, ActionListener<PercolateResponse> listener)
          Percolates a request returning the matches documents.
 BulkRequestBuilder prepareBulk()
          Executes a bulk of index / delete operations.
 CountRequestBuilder prepareCount(String... indices)
          A count of all the documents matching a specific query.
 DeleteRequestBuilder prepareDelete()
          Deletes a document from the index based on the index, type and id.
 DeleteRequestBuilder prepareDelete(String index, String type, String id)
          Deletes a document from the index based on the index, type and id.
 DeleteByQueryRequestBuilder prepareDeleteByQuery(String... indices)
          Deletes all documents from one or more indices based on a query.
<Request extends ActionRequest,Response extends ActionResponse,RequestBuilder extends ActionRequestBuilder<Request,Response>>
RequestBuilder
prepareExecute(Action<Request,Response,RequestBuilder> action)
          Prepares a request builder to execute, specified by Action.
 ExplainRequestBuilder prepareExplain(String index, String type, String id)
          Computes a score explanation for the specified request.
 GetRequestBuilder prepareGet()
          Gets the document that was indexed from an index with a type and id.
 GetRequestBuilder prepareGet(String index, String type, String id)
          Gets the document that was indexed from an index with a type (optional) and id.
 IndexRequestBuilder prepareIndex()
          Index a document associated with a given index and type.
 IndexRequestBuilder prepareIndex(String index, String type)
          Index a document associated with a given index and type.
 IndexRequestBuilder prepareIndex(String index, String type, String id)
          Index a document associated with a given index and type.
 MoreLikeThisRequestBuilder prepareMoreLikeThis(String index, String type, String id)
          A more like this action to search for documents that are "like" a specific document.
 MultiGetRequestBuilder prepareMultiGet()
          Multi get documents.
 MultiSearchRequestBuilder prepareMultiSearch()
          Performs multiple search requests.
 PercolateRequestBuilder preparePercolate(String index, String type)
          Percolates a request returning the matches documents.
 SearchRequestBuilder prepareSearch(String... indices)
          Search across one or more indices and one or more types with a query.
 SearchScrollRequestBuilder prepareSearchScroll(String scrollId)
          A search scroll request to continue searching a previous scrollable search request.
 UpdateRequestBuilder prepareUpdate()
          Updates a document based on a script.
 UpdateRequestBuilder prepareUpdate(String index, String type, String id)
          Updates a document based on a script.
 ActionFuture<SearchResponse> search(SearchRequest request)
          Search across one or more indices and one or more types with a query.
 void search(SearchRequest request, ActionListener<SearchResponse> listener)
          Search across one or more indices and one or more types with a query.
 ActionFuture<SearchResponse> searchScroll(SearchScrollRequest request)
          A search scroll request to continue searching a previous scrollable search request.
 void searchScroll(SearchScrollRequest request, ActionListener<SearchResponse> listener)
          A search scroll request to continue searching a previous scrollable search request.
 ActionFuture<UpdateResponse> update(UpdateRequest request)
          Updates a document based on a script.
 void update(UpdateRequest request, ActionListener<UpdateResponse> listener)
          Updates a document based on a script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.elasticsearch.client.internal.InternalClient
settings, threadPool
 
Methods inherited from interface org.elasticsearch.client.Client
admin, close, execute, execute
 

Constructor Detail

AbstractClient

public AbstractClient()
Method Detail

prepareExecute

public <Request extends ActionRequest,Response extends ActionResponse,RequestBuilder extends ActionRequestBuilder<Request,Response>> RequestBuilder prepareExecute(Action<Request,Response,RequestBuilder> action)
Description copied from interface: Client
Prepares a request builder to execute, specified by Action.

Specified by:
prepareExecute in interface Client
Type Parameters:
Request - The request type.
Response - The response type.
RequestBuilder - The request builder.
Parameters:
action - The action type to execute.
Returns:
The request builder, that can, at a later stage, execute the request.

index

public ActionFuture<IndexResponse> index(IndexRequest request)
Description copied from interface: Client
Index a JSON source associated with a given index and type.

The id is optional, if it is not provided, one will be generated automatically.

Specified by:
index in interface Client
Parameters:
request - The index request
Returns:
The result future
See Also:
Requests.indexRequest(String)

index

public void index(IndexRequest request,
                  ActionListener<IndexResponse> listener)
Description copied from interface: Client
Index a document associated with a given index and type.

The id is optional, if it is not provided, one will be generated automatically.

Specified by:
index in interface Client
Parameters:
request - The index request
listener - A listener to be notified with a result
See Also:
Requests.indexRequest(String)

prepareIndex

public IndexRequestBuilder prepareIndex()
Description copied from interface: Client
Index a document associated with a given index and type.

The id is optional, if it is not provided, one will be generated automatically.

Specified by:
prepareIndex in interface Client

prepareIndex

public IndexRequestBuilder prepareIndex(String index,
                                        String type)
Description copied from interface: Client
Index a document associated with a given index and type.

The id is optional, if it is not provided, one will be generated automatically.

Specified by:
prepareIndex in interface Client
Parameters:
index - The index to index the document to
type - The type to index the document to

prepareIndex

public IndexRequestBuilder prepareIndex(String index,
                                        String type,
                                        @Nullable
                                        String id)
Description copied from interface: Client
Index a document associated with a given index and type.

The id is optional, if it is not provided, one will be generated automatically.

Specified by:
prepareIndex in interface Client
Parameters:
index - The index to index the document to
type - The type to index the document to
id - The id of the document

update

public ActionFuture<UpdateResponse> update(UpdateRequest request)
Description copied from interface: Client
Updates a document based on a script.

Specified by:
update in interface Client
Parameters:
request - The update request
Returns:
The result future

update

public void update(UpdateRequest request,
                   ActionListener<UpdateResponse> listener)
Description copied from interface: Client
Updates a document based on a script.

Specified by:
update in interface Client
Parameters:
request - The update request
listener - A listener to be notified with a result

prepareUpdate

public UpdateRequestBuilder prepareUpdate()
Description copied from interface: Client
Updates a document based on a script.

Specified by:
prepareUpdate in interface Client

prepareUpdate

public UpdateRequestBuilder prepareUpdate(String index,
                                          String type,
                                          String id)
Description copied from interface: Client
Updates a document based on a script.

Specified by:
prepareUpdate in interface Client

delete

public ActionFuture<DeleteResponse> delete(DeleteRequest request)
Description copied from interface: Client
Deletes a document from the index based on the index, type and id.

Specified by:
delete in interface Client
Parameters:
request - The delete request
Returns:
The result future
See Also:
Requests.deleteRequest(String)

delete

public void delete(DeleteRequest request,
                   ActionListener<DeleteResponse> listener)
Description copied from interface: Client
Deletes a document from the index based on the index, type and id.

Specified by:
delete in interface Client
Parameters:
request - The delete request
listener - A listener to be notified with a result
See Also:
Requests.deleteRequest(String)

prepareDelete

public DeleteRequestBuilder prepareDelete()
Description copied from interface: Client
Deletes a document from the index based on the index, type and id.

Specified by:
prepareDelete in interface Client

prepareDelete

public DeleteRequestBuilder prepareDelete(String index,
                                          String type,
                                          String id)
Description copied from interface: Client
Deletes a document from the index based on the index, type and id.

Specified by:
prepareDelete in interface Client
Parameters:
index - The index to delete the document from
type - The type of the document to delete
id - The id of the document to delete

bulk

public ActionFuture<BulkResponse> bulk(BulkRequest request)
Description copied from interface: Client
Executes a bulk of index / delete operations.

Specified by:
bulk in interface Client
Parameters:
request - The bulk request
Returns:
The result future
See Also:
Requests.bulkRequest()

bulk

public void bulk(BulkRequest request,
                 ActionListener<BulkResponse> listener)
Description copied from interface: Client
Executes a bulk of index / delete operations.

Specified by:
bulk in interface Client
Parameters:
request - The bulk request
listener - A listener to be notified with a result
See Also:
Requests.bulkRequest()

prepareBulk

public BulkRequestBuilder prepareBulk()
Description copied from interface: Client
Executes a bulk of index / delete operations.

Specified by:
prepareBulk in interface Client

deleteByQuery

public ActionFuture<DeleteByQueryResponse> deleteByQuery(DeleteByQueryRequest request)
Description copied from interface: Client
Deletes all documents from one or more indices based on a query.

Specified by:
deleteByQuery in interface Client
Parameters:
request - The delete by query request
Returns:
The result future
See Also:
Requests.deleteByQueryRequest(String...)

deleteByQuery

public void deleteByQuery(DeleteByQueryRequest request,
                          ActionListener<DeleteByQueryResponse> listener)
Description copied from interface: Client
Deletes all documents from one or more indices based on a query.

Specified by:
deleteByQuery in interface Client
Parameters:
request - The delete by query request
listener - A listener to be notified with a result
See Also:
Requests.deleteByQueryRequest(String...)

prepareDeleteByQuery

public DeleteByQueryRequestBuilder prepareDeleteByQuery(String... indices)
Description copied from interface: Client
Deletes all documents from one or more indices based on a query.

Specified by:
prepareDeleteByQuery in interface Client

get

public ActionFuture<GetResponse> get(GetRequest request)
Description copied from interface: Client
Gets the document that was indexed from an index with a type and id.

Specified by:
get in interface Client
Parameters:
request - The get request
Returns:
The result future
See Also:
Requests.getRequest(String)

get

public void get(GetRequest request,
                ActionListener<GetResponse> listener)
Description copied from interface: Client
Gets the document that was indexed from an index with a type and id.

Specified by:
get in interface Client
Parameters:
request - The get request
listener - A listener to be notified with a result
See Also:
Requests.getRequest(String)

prepareGet

public GetRequestBuilder prepareGet()
Description copied from interface: Client
Gets the document that was indexed from an index with a type and id.

Specified by:
prepareGet in interface Client

prepareGet

public GetRequestBuilder prepareGet(String index,
                                    String type,
                                    String id)
Description copied from interface: Client
Gets the document that was indexed from an index with a type (optional) and id.

Specified by:
prepareGet in interface Client

multiGet

public ActionFuture<MultiGetResponse> multiGet(MultiGetRequest request)
Description copied from interface: Client
Multi get documents.

Specified by:
multiGet in interface Client

multiGet

public void multiGet(MultiGetRequest request,
                     ActionListener<MultiGetResponse> listener)
Description copied from interface: Client
Multi get documents.

Specified by:
multiGet in interface Client

prepareMultiGet

public MultiGetRequestBuilder prepareMultiGet()
Description copied from interface: Client
Multi get documents.

Specified by:
prepareMultiGet in interface Client

search

public ActionFuture<SearchResponse> search(SearchRequest request)
Description copied from interface: Client
Search across one or more indices and one or more types with a query.

Specified by:
search in interface Client
Parameters:
request - The search request
Returns:
The result future
See Also:
Requests.searchRequest(String...)

search

public void search(SearchRequest request,
                   ActionListener<SearchResponse> listener)
Description copied from interface: Client
Search across one or more indices and one or more types with a query.

Specified by:
search in interface Client
Parameters:
request - The search request
listener - A listener to be notified of the result
See Also:
Requests.searchRequest(String...)

prepareSearch

public SearchRequestBuilder prepareSearch(String... indices)
Description copied from interface: Client
Search across one or more indices and one or more types with a query.

Specified by:
prepareSearch in interface Client

searchScroll

public ActionFuture<SearchResponse> searchScroll(SearchScrollRequest request)
Description copied from interface: Client
A search scroll request to continue searching a previous scrollable search request.

Specified by:
searchScroll in interface Client
Parameters:
request - The search scroll request
Returns:
The result future
See Also:
Requests.searchScrollRequest(String)

searchScroll

public void searchScroll(SearchScrollRequest request,
                         ActionListener<SearchResponse> listener)
Description copied from interface: Client
A search scroll request to continue searching a previous scrollable search request.

Specified by:
searchScroll in interface Client
Parameters:
request - The search scroll request
listener - A listener to be notified of the result
See Also:
Requests.searchScrollRequest(String)

prepareSearchScroll

public SearchScrollRequestBuilder prepareSearchScroll(String scrollId)
Description copied from interface: Client
A search scroll request to continue searching a previous scrollable search request.

Specified by:
prepareSearchScroll in interface Client

multiSearch

public ActionFuture<MultiSearchResponse> multiSearch(MultiSearchRequest request)
Description copied from interface: Client
Performs multiple search requests.

Specified by:
multiSearch in interface Client

multiSearch

public void multiSearch(MultiSearchRequest request,
                        ActionListener<MultiSearchResponse> listener)
Description copied from interface: Client
Performs multiple search requests.

Specified by:
multiSearch in interface Client

prepareMultiSearch

public MultiSearchRequestBuilder prepareMultiSearch()
Description copied from interface: Client
Performs multiple search requests.

Specified by:
prepareMultiSearch in interface Client

count

public ActionFuture<CountResponse> count(CountRequest request)
Description copied from interface: Client
A count of all the documents matching a specific query.

Specified by:
count in interface Client
Parameters:
request - The count request
Returns:
The result future
See Also:
Requests.countRequest(String...)

count

public void count(CountRequest request,
                  ActionListener<CountResponse> listener)
Description copied from interface: Client
A count of all the documents matching a specific query.

Specified by:
count in interface Client
Parameters:
request - The count request
listener - A listener to be notified of the result
See Also:
Requests.countRequest(String...)

prepareCount

public CountRequestBuilder prepareCount(String... indices)
Description copied from interface: Client
A count of all the documents matching a specific query.

Specified by:
prepareCount in interface Client

moreLikeThis

public ActionFuture<SearchResponse> moreLikeThis(MoreLikeThisRequest request)
Description copied from interface: Client
A more like this action to search for documents that are "like" a specific document.

Specified by:
moreLikeThis in interface Client
Parameters:
request - The more like this request
Returns:
The response future

moreLikeThis

public void moreLikeThis(MoreLikeThisRequest request,
                         ActionListener<SearchResponse> listener)
Description copied from interface: Client
A more like this action to search for documents that are "like" a specific document.

Specified by:
moreLikeThis in interface Client
Parameters:
request - The more like this request
listener - A listener to be notified of the result

prepareMoreLikeThis

public MoreLikeThisRequestBuilder prepareMoreLikeThis(String index,
                                                      String type,
                                                      String id)
Description copied from interface: Client
A more like this action to search for documents that are "like" a specific document.

Specified by:
prepareMoreLikeThis in interface Client
Parameters:
index - The index to load the document from
type - The type of the document
id - The id of the document

percolate

public ActionFuture<PercolateResponse> percolate(PercolateRequest request)
Description copied from interface: Client
Percolates a request returning the matches documents.

Specified by:
percolate in interface Client

percolate

public void percolate(PercolateRequest request,
                      ActionListener<PercolateResponse> listener)
Description copied from interface: Client
Percolates a request returning the matches documents.

Specified by:
percolate in interface Client

preparePercolate

public PercolateRequestBuilder preparePercolate(String index,
                                                String type)
Description copied from interface: Client
Percolates a request returning the matches documents.

Specified by:
preparePercolate in interface Client
Parameters:
index - The index to percolate the doc
type - The type of the doc

prepareExplain

public ExplainRequestBuilder prepareExplain(String index,
                                            String type,
                                            String id)
Description copied from interface: Client
Computes a score explanation for the specified request.

Specified by:
prepareExplain in interface Client
Parameters:
index - The index this explain is targeted for
type - The type this explain is targeted for
id - The document identifier this explain is targeted for

explain

public ActionFuture<ExplainResponse> explain(ExplainRequest request)
Description copied from interface: Client
Computes a score explanation for the specified request.

Specified by:
explain in interface Client
Parameters:
request - The request encapsulating the query and document identifier to compute a score explanation for

explain

public void explain(ExplainRequest request,
                    ActionListener<ExplainResponse> listener)
Description copied from interface: Client
Computes a score explanation for the specified request.

Specified by:
explain in interface Client
Parameters:
request - The request encapsulating the query and document identifier to compute a score explanation for
listener - A listener to be notified of the result


Copyright © 2009-2012. All Rights Reserved.