Module org.elasticsearch.server
Class AbstractClient
java.lang.Object
org.elasticsearch.client.internal.support.AbstractClient
- All Implemented Interfaces:
Client,ElasticsearchClient
- Direct Known Subclasses:
FilterClient,NodeClient
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractClient(Settings settings, ThreadPool threadPool, ProjectResolver projectResolver) -
Method Summary
Modifier and TypeMethodDescriptionfinal AdminClientadmin()The admin client that can be used to perform administrative operations.bulk(BulkRequest request) Executes a bulk of index / delete operations.voidbulk(BulkRequest request, ActionListener<BulkResponse> listener) Executes a bulk of index / delete operations.clearScroll(ClearScrollRequest request) Clears the search contexts associated with specified scroll ids.voidclearScroll(ClearScrollRequest request, ActionListener<ClearScrollResponse> listener) Clears the search contexts associated with specified scroll ids.delete(DeleteRequest request) Deletes a document from the index based on the index and id.voiddelete(DeleteRequest request, ActionListener<DeleteResponse> listener) Deletes a document from the index based on the index and id.protected abstract <Request extends ActionRequest,Response extends ActionResponse>
voiddoExecute(ActionType<Response> action, Request request, ActionListener<Response> listener) final <Request extends ActionRequest,Response extends ActionResponse>
ActionFuture<Response> execute(ActionType<Response> action, Request request) Executes a generic action, denoted by anActionType.final <Request extends ActionRequest,Response extends ActionResponse>
voidexecute(ActionType<Response> action, Request request, ActionListener<Response> listener) This is the single execution point of *all* clients.explain(ExplainRequest request) Computes a score explanation for the specified request.voidexplain(ExplainRequest request, ActionListener<ExplainResponse> listener) Computes a score explanation for the specified request.fieldCaps(FieldCapabilitiesRequest request) An action that returns the field capabilities from the provided requestvoidfieldCaps(FieldCapabilitiesRequest request, ActionListener<FieldCapabilitiesResponse> listener) An action that returns the field capabilities from the provided requestfilterWithHeader(Map<String, String> headers) Returns a new lightweight Client that applies all given headers to each of the requests issued from it.get(GetRequest request) Gets the document that was indexed from an index with an id.voidget(GetRequest request, ActionListener<GetResponse> listener) Gets the document that was indexed from an index with an id.index(IndexRequest request) Index a JSON source associated with a given index.voidindex(IndexRequest request, ActionListener<DocWriteResponse> listener) Index a document associated with a given index.multiGet(MultiGetRequest request) Multi get documents.voidmultiGet(MultiGetRequest request, ActionListener<MultiGetResponse> listener) Multi get documents.multiSearch(MultiSearchRequest request) Performs multiple search requests.voidmultiSearch(MultiSearchRequest request, ActionListener<MultiSearchResponse> listener) Performs multiple search requests.multiTermVectors(MultiTermVectorsRequest request) Multi get term vectors.voidmultiTermVectors(MultiTermVectorsRequest request, ActionListener<MultiTermVectorsResponse> listener) Multi get term vectors.Executes a bulk of index / delete operations.prepareBulk(String globalIndex) Executes a bulk of index / delete operations with default indexClears the search contexts associated with specified scroll ids.Deletes a document from the index based on the index and id.prepareDelete(String index, String id) Deletes a document from the index based on the index and id.prepareExplain(String index, String id) Computes a score explanation for the specified request.prepareFieldCaps(String... indices) Builder for the field capabilities request.Gets the document that was indexed from an index with an id.prepareGet(String index, String id) Gets the document that was indexed from an index with an id.Index a document associated with a given index.prepareIndex(String index) Index a document associated with a given index.Multi get documents.Performs multiple search requests.Multi get term vectors.prepareSearch(String... indices) Search across one or more indices with a query.prepareSearchScroll(String scrollId) A search scroll request to continue searching a previous scrollable search request.Builder for the term vector request.prepareTermVectors(String index, String id) Builder for the term vector request.Updates a document based on a script.prepareUpdate(String index, String id) Updates a document based on a script.projectClient(ProjectId projectId) Returns a client that executes every request in the context of the given project.Returns this client's project resolver.search(SearchRequest request) Search across one or more indices with a query.voidsearch(SearchRequest request, ActionListener<SearchResponse> listener) Search across one or more indices with a query.searchScroll(SearchScrollRequest request) A search scroll request to continue searching a previous scrollable search request.voidsearchScroll(SearchScrollRequest request, ActionListener<SearchResponse> listener) A search scroll request to continue searching a previous scrollable search request.final Settingssettings()Returns this clients settingstermVectors(TermVectorsRequest request) An action that returns the term vectors for a specific document.voidtermVectors(TermVectorsRequest request, ActionListener<TermVectorsResponse> listener) An action that returns the term vectors for a specific document.final ThreadPoolReturns the threadpool used to execute requests on this clientupdate(UpdateRequest request) Updates a document based on a script.voidupdate(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, waitMethods inherited from interface org.elasticsearch.client.internal.Client
getRemoteClusterClient
-
Field Details
-
logger
protected final org.apache.logging.log4j.Logger logger -
settings
-
-
Constructor Details
-
AbstractClient
-
-
Method Details
-
settings
Description copied from interface:ClientReturns this clients settings -
threadPool
Description copied from interface:ElasticsearchClientReturns the threadpool used to execute requests on this client- Specified by:
threadPoolin interfaceElasticsearchClient
-
projectResolver
Description copied from interface:ClientReturns this client's project resolver.- Specified by:
projectResolverin interfaceClient
-
admin
Description copied from interface:ClientThe admin client that can be used to perform administrative operations. -
execute
public final <Request extends ActionRequest,Response extends ActionResponse> ActionFuture<Response> execute(ActionType<Response> action, Request request) Description copied from interface:ElasticsearchClientExecutes a generic action, denoted by anActionType.- Specified by:
executein interfaceElasticsearchClient- Type Parameters:
Request- The request type.Response- the response type.- Parameters:
action- The action type to execute.request- The action request.- Returns:
- A future allowing to get back the response.
-
execute
public final <Request extends ActionRequest,Response extends ActionResponse> void execute(ActionType<Response> action, Request request, ActionListener<Response> listener) This is the single execution point of *all* clients.- Specified by:
executein interfaceElasticsearchClient- Type Parameters:
Request- The request type.Response- The response type.- Parameters:
action- The action type to execute.request- The action request.listener- The listener to receive the response back.
-
doExecute
protected abstract <Request extends ActionRequest,Response extends ActionResponse> void doExecute(ActionType<Response> action, Request request, ActionListener<Response> listener) -
index
Description copied from interface:ClientIndex a JSON source associated with a given index.The id is optional, if it is not provided, one will be generated automatically.
-
index
Description copied from interface:ClientIndex a document associated with a given index.The id is optional, if it is not provided, one will be generated automatically.
-
prepareIndex
Description copied from interface:ClientIndex a document associated with a given index.The id is optional, if it is not provided, one will be generated automatically.
- Specified by:
prepareIndexin interfaceClient
-
prepareIndex
Description copied from interface:ClientIndex a document associated with a given index.The id is optional, if it is not provided, one will be generated automatically.
- Specified by:
prepareIndexin interfaceClient- Parameters:
index- The index to index the document to
-
update
Description copied from interface:ClientUpdates a document based on a script. -
update
Description copied from interface:ClientUpdates a document based on a script. -
prepareUpdate
Description copied from interface:ClientUpdates a document based on a script.- Specified by:
prepareUpdatein interfaceClient
-
prepareUpdate
Description copied from interface:ClientUpdates a document based on a script.- Specified by:
prepareUpdatein interfaceClient
-
delete
Description copied from interface:ClientDeletes a document from the index based on the index and id. -
delete
Description copied from interface:ClientDeletes a document from the index based on the index and id. -
prepareDelete
Description copied from interface:ClientDeletes a document from the index based on the index and id.- Specified by:
prepareDeletein interfaceClient
-
prepareDelete
Description copied from interface:ClientDeletes a document from the index based on the index and id.- Specified by:
prepareDeletein interfaceClient- Parameters:
index- The index to delete the document fromid- The id of the document to delete
-
bulk
Description copied from interface:ClientExecutes a bulk of index / delete operations. -
bulk
Description copied from interface:ClientExecutes a bulk of index / delete operations. -
prepareBulk
Description copied from interface:ClientExecutes a bulk of index / delete operations.- Specified by:
prepareBulkin interfaceClient
-
prepareBulk
Description copied from interface:ClientExecutes a bulk of index / delete operations with default index- Specified by:
prepareBulkin interfaceClient
-
get
Description copied from interface:ClientGets the document that was indexed from an index with an id. -
get
Description copied from interface:ClientGets the document that was indexed from an index with an id. -
prepareGet
Description copied from interface:ClientGets the document that was indexed from an index with an id.- Specified by:
prepareGetin interfaceClient
-
prepareGet
Description copied from interface:ClientGets the document that was indexed from an index with an id.- Specified by:
prepareGetin interfaceClient
-
multiGet
Description copied from interface:ClientMulti get documents. -
multiGet
Description copied from interface:ClientMulti get documents. -
prepareMultiGet
Description copied from interface:ClientMulti get documents.- Specified by:
prepareMultiGetin interfaceClient
-
search
Description copied from interface:ClientSearch across one or more indices with a query. -
search
Description copied from interface:ClientSearch across one or more indices with a query. -
prepareSearch
Description copied from interface:ClientSearch across one or more indices with a query.- Specified by:
prepareSearchin interfaceClient
-
searchScroll
Description copied from interface:ClientA search scroll request to continue searching a previous scrollable search request.- Specified by:
searchScrollin interfaceClient- Parameters:
request- The search scroll request- Returns:
- The result future
-
searchScroll
Description copied from interface:ClientA search scroll request to continue searching a previous scrollable search request.- Specified by:
searchScrollin interfaceClient- Parameters:
request- The search scroll requestlistener- A listener to be notified of the result
-
prepareSearchScroll
Description copied from interface:ClientA search scroll request to continue searching a previous scrollable search request.- Specified by:
prepareSearchScrollin interfaceClient
-
multiSearch
Description copied from interface:ClientPerforms multiple search requests.- Specified by:
multiSearchin interfaceClient
-
multiSearch
Description copied from interface:ClientPerforms multiple search requests.- Specified by:
multiSearchin interfaceClient
-
prepareMultiSearch
Description copied from interface:ClientPerforms multiple search requests.- Specified by:
prepareMultiSearchin interfaceClient
-
termVectors
Description copied from interface:ClientAn action that returns the term vectors for a specific document.- Specified by:
termVectorsin interfaceClient- Parameters:
request- The term vector request- Returns:
- The response future
-
termVectors
Description copied from interface:ClientAn action that returns the term vectors for a specific document.- Specified by:
termVectorsin interfaceClient- Parameters:
request- The term vector request
-
prepareTermVectors
Description copied from interface:ClientBuilder for the term vector request.- Specified by:
prepareTermVectorsin interfaceClient
-
prepareTermVectors
Description copied from interface:ClientBuilder for the term vector request.- Specified by:
prepareTermVectorsin interfaceClient- Parameters:
index- The index to load the document fromid- The id of the document
-
multiTermVectors
Description copied from interface:ClientMulti get term vectors.- Specified by:
multiTermVectorsin interfaceClient
-
multiTermVectors
public void multiTermVectors(MultiTermVectorsRequest request, ActionListener<MultiTermVectorsResponse> listener) Description copied from interface:ClientMulti get term vectors.- Specified by:
multiTermVectorsin interfaceClient
-
prepareMultiTermVectors
Description copied from interface:ClientMulti get term vectors.- Specified by:
prepareMultiTermVectorsin interfaceClient
-
prepareExplain
Description copied from interface:ClientComputes a score explanation for the specified request.- Specified by:
prepareExplainin interfaceClient- Parameters:
index- The index this explain is targeted forid- The document identifier this explain is targeted for
-
explain
Description copied from interface:ClientComputes a score explanation for the specified request. -
explain
Description copied from interface:ClientComputes a score explanation for the specified request. -
clearScroll
Description copied from interface:ClientClears the search contexts associated with specified scroll ids.- Specified by:
clearScrollin interfaceClient
-
clearScroll
Description copied from interface:ClientClears the search contexts associated with specified scroll ids.- Specified by:
clearScrollin interfaceClient
-
prepareClearScroll
Description copied from interface:ClientClears the search contexts associated with specified scroll ids.- Specified by:
prepareClearScrollin interfaceClient
-
fieldCaps
public void fieldCaps(FieldCapabilitiesRequest request, ActionListener<FieldCapabilitiesResponse> listener) Description copied from interface:ClientAn action that returns the field capabilities from the provided request -
fieldCaps
Description copied from interface:ClientAn action that returns the field capabilities from the provided request -
prepareFieldCaps
Description copied from interface:ClientBuilder for the field capabilities request.- Specified by:
prepareFieldCapsin interfaceClient
-
filterWithHeader
Description copied from interface:ClientReturns a new lightweight Client that applies all given headers to each of the requests issued from it.- Specified by:
filterWithHeaderin interfaceClient
-
projectClient
Description copied from interface:ClientReturns a client that executes every request in the context of the given project.- Specified by:
projectClientin interfaceClient
-