Package org.nuxeo.elasticsearch.client
Class ESRestClient
java.lang.Object
org.nuxeo.elasticsearch.client.ESRestClient
- All Implemented Interfaces:
AutoCloseable,ESClient
- Since:
- 9.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException when Elastic is overloaded by indexing requests. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionESRestClient(org.opensearch.client.RestClient lowLevelRestClient, org.opensearch.client.RestHighLevelClient client) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaliasExists(String aliasName) org.opensearch.action.bulk.BulkResponsebulk(org.opensearch.action.bulk.BulkRequest request) org.opensearch.action.bulk.BulkProcessor.BuilderbulkProcessorBuilder(org.opensearch.action.bulk.BulkProcessor.Listener bulkListener) Creates an elasticsearch BulkProcessor builder.org.opensearch.action.search.ClearScrollResponseclearScroll(org.opensearch.action.search.ClearScrollRequest request) voidclose()protected voidcreateAlias(String aliasName, String indexName) voidcreateIndex(String indexName, String jsonSettings) voidcreateMapping(String indexName, String type, String jsonMapping) org.opensearch.action.delete.DeleteResponsedelete(org.opensearch.action.delete.DeleteRequest request) protected voiddeleteAlias(String aliasName) voiddeleteIndex(String indexName, int timeoutSecond) protected org.opensearch.action.bulk.BulkResponsedoBulk(org.opensearch.action.bulk.BulkRequest request) protected org.opensearch.action.delete.DeleteResponsedoDelete(org.opensearch.action.delete.DeleteRequest request) protected org.opensearch.action.index.IndexResponsedoIndex(org.opensearch.action.index.IndexRequest request) voidorg.opensearch.action.get.GetResponseget(org.opensearch.action.get.GetRequest request) getFirstIndexForAlias(String aliasName) Returns the name of the index referenced by the alias.org.opensearch.cluster.health.ClusterHealthStatusgetHealthStatus(String[] indexNames) protected StringgetIndexesAsString(String[] indexNames) getMapping(String indexName) Returns the mapping from elastic, exposed for testing purposesprotected io.opencensus.common.ScopegetScopedSpan(String name, String request) org.opensearch.action.index.IndexResponseindex(org.opensearch.action.index.IndexRequest request) Performs the indexing request.booleanindexExists(String indexName) booleanmappingExists(String indexName, String type) voidprotected org.opensearch.client.ResponseperformRequest(org.opensearch.client.Request request) protected <I extends org.opensearch.action.ActionRequest,O extends org.opensearch.action.ActionResponse>
OperformRequestWithTracing(ThrowableBiFunction<I, org.opensearch.client.RequestOptions, O, IOException> runner, I request, String spanName) org.opensearch.client.ResponseperformRequestWithTracing(org.opensearch.client.Request request) Performs an Elastic request using the low level client, exposed since 11.5 for internal use only.voidorg.opensearch.action.search.SearchResponsesearch(org.opensearch.action.search.SearchRequest request) org.opensearch.action.search.SearchResponsesearchScroll(org.opensearch.action.search.SearchScrollRequest request) voidupdateAlias(String aliasName, String indexName) booleanwaitForYellowStatus(String[] indexNames, int timeoutSecond)
-
Field Details
-
LONG_TIMEOUT
- See Also:
-
CREATE_INDEX_TIMEOUT
Deprecated.useLONG_TIMEOUTinstead- See Also:
-
lowLevelClient
protected org.opensearch.client.RestClient lowLevelClient -
client
protected org.opensearch.client.RestHighLevelClient client -
COMPAT_ES_OPTIONS
protected org.opensearch.client.RequestOptions COMPAT_ES_OPTIONS
-
-
Constructor Details
-
ESRestClient
public ESRestClient(org.opensearch.client.RestClient lowLevelRestClient, org.opensearch.client.RestHighLevelClient client)
-
-
Method Details
-
waitForYellowStatus
- Specified by:
waitForYellowStatusin interfaceESClient
-
getIndexesAsString
-
getHealthStatus
- Specified by:
getHealthStatusin interfaceESClient
-
refresh
-
flush
-
optimize
-
indexExists
- Specified by:
indexExistsin interfaceESClient
-
mappingExists
- Specified by:
mappingExistsin interfaceESClient
-
deleteIndex
- Specified by:
deleteIndexin interfaceESClient
-
createIndex
- Specified by:
createIndexin interfaceESClient
-
createMapping
- Specified by:
createMappingin interfaceESClient
-
getMapping
Description copied from interface:ESClientReturns the mapping from elastic, exposed for testing purposes- Specified by:
getMappingin interfaceESClient
-
performRequest
protected org.opensearch.client.Response performRequest(org.opensearch.client.Request request) -
performRequestWithTracing
public org.opensearch.client.Response performRequestWithTracing(org.opensearch.client.Request request) Performs an Elastic request using the low level client, exposed since 11.5 for internal use only. -
performRequestWithTracing
protected <I extends org.opensearch.action.ActionRequest,O extends org.opensearch.action.ActionResponse> O performRequestWithTracing(ThrowableBiFunction<I, org.opensearch.client.RequestOptions, throws ESRestClient.TooManyRequestsRetryableExceptionO, IOException> runner, I request, String spanName) -
getNodesInfo
- Specified by:
getNodesInfoin interfaceESClient
-
getNodesStats
- Specified by:
getNodesStatsin interfaceESClient
-
aliasExists
- Specified by:
aliasExistsin interfaceESClient
-
getFirstIndexForAlias
Description copied from interface:ESClientReturns the name of the index referenced by the alias. Returns null if the alias does not exists.- Specified by:
getFirstIndexForAliasin interfaceESClient
-
updateAlias
- Specified by:
updateAliasin interfaceESClient
-
deleteAlias
-
createAlias
-
bulk
public org.opensearch.action.bulk.BulkResponse bulk(org.opensearch.action.bulk.BulkRequest request) -
doBulk
protected org.opensearch.action.bulk.BulkResponse doBulk(org.opensearch.action.bulk.BulkRequest request) throws ESRestClient.TooManyRequestsRetryableException -
delete
public org.opensearch.action.delete.DeleteResponse delete(org.opensearch.action.delete.DeleteRequest request) -
doDelete
protected org.opensearch.action.delete.DeleteResponse doDelete(org.opensearch.action.delete.DeleteRequest request) throws ESRestClient.TooManyRequestsRetryableException -
search
public org.opensearch.action.search.SearchResponse search(org.opensearch.action.search.SearchRequest request) -
searchScroll
public org.opensearch.action.search.SearchResponse searchScroll(org.opensearch.action.search.SearchScrollRequest request) - Specified by:
searchScrollin interfaceESClient
-
get
public org.opensearch.action.get.GetResponse get(org.opensearch.action.get.GetRequest request) -
index
public org.opensearch.action.index.IndexResponse index(org.opensearch.action.index.IndexRequest request) Description copied from interface:ESClientPerforms the indexing request. -
doIndex
protected org.opensearch.action.index.IndexResponse doIndex(org.opensearch.action.index.IndexRequest request) throws ESRestClient.TooManyRequestsRetryableException -
getScopedSpan
-
clearScroll
public org.opensearch.action.search.ClearScrollResponse clearScroll(org.opensearch.action.search.ClearScrollRequest request) - Specified by:
clearScrollin interfaceESClient
-
bulkProcessorBuilder
public org.opensearch.action.bulk.BulkProcessor.Builder bulkProcessorBuilder(org.opensearch.action.bulk.BulkProcessor.Listener bulkListener) Description copied from interface:ESClientCreates an elasticsearch BulkProcessor builder.- Specified by:
bulkProcessorBuilderin interfaceESClient
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
LONG_TIMEOUTinstead