Class OpenSearchRestClient
java.lang.Object
org.nuxeo.runtime.opensearch1.client.OpenSearchRestClient
- All Implemented Interfaces:
AutoCloseable,OpenSearchClient
- Since:
- 9.3
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenSearchRestClient(String id, org.opensearch.client.RestHighLevelClient client) -
Method Summary
Modifier and TypeMethodDescriptionorg.opensearch.action.bulk.BulkResponsebulk(org.opensearch.action.bulk.BulkRequest request) org.opensearch.action.search.ClearScrollResponseclearScroll(org.opensearch.action.search.ClearScrollRequest request) voidclose()voidcreateIndex(String indexName, String jsonSettings) voidcreateMapping(String indexName, String jsonMapping) protected org.opensearch.action.bulk.BulkResponsedoBulk(org.opensearch.action.bulk.BulkRequest request) protected org.opensearch.action.index.IndexResponsedoIndex(org.opensearch.action.index.IndexRequest request) voidvoidorg.opensearch.action.get.GetResponseget(org.opensearch.action.get.GetRequest request) getId()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) booleanindexExists(String indexName) booleanisReady()booleanmappingExists(String indexName) voidprotected <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) Deprecated, for removal: This API element is subject to removal in a future version.voidorg.opensearch.action.search.SearchResponsescroll(org.opensearch.action.search.SearchScrollRequest request) org.opensearch.action.search.SearchResponsesearch(org.opensearch.action.search.SearchRequest request) booleanwaitForYellowStatus(String[] indexNames, Duration timeout) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.opensearch1.client.OpenSearchClient
dropIndex
-
Field Details
-
LONG_TIMEOUT
- See Also:
-
CREATE_INDEX_TIMEOUT
Deprecated.useLONG_TIMEOUTinstead- See Also:
-
id
-
client
protected final org.opensearch.client.RestHighLevelClient client -
COMPAT_ES_OPTIONS
protected org.opensearch.client.RequestOptions COMPAT_ES_OPTIONS
-
-
Constructor Details
-
OpenSearchRestClient
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceOpenSearchClient- Returns:
- The client id
-
isReady
public boolean isReady()- Specified by:
isReadyin interfaceOpenSearchClient- Returns:
- Whether the targeted OpenSearch is ready or not (its status is at least
ClusterHealthStatus.YELLOW
-
waitForYellowStatus
- Specified by:
waitForYellowStatusin interfaceOpenSearchClient
-
getIndexesAsString
-
refresh
- Specified by:
refreshin interfaceOpenSearchClient
-
flush
- Specified by:
flushin interfaceOpenSearchClient
-
optimize
- Specified by:
optimizein interfaceOpenSearchClient
-
createIndex
- Specified by:
createIndexin interfaceOpenSearchClient
-
indexExists
- Specified by:
indexExistsin interfaceOpenSearchClient
-
dropIndex
- Specified by:
dropIndexin interfaceOpenSearchClient
-
createMapping
- Specified by:
createMappingin interfaceOpenSearchClient
-
mappingExists
- Specified by:
mappingExistsin interfaceOpenSearchClient
-
getMapping
Description copied from interface:OpenSearchClientReturns the mapping from elastic, exposed for testing purposes- Specified by:
getMappingin interfaceOpenSearchClient
-
performRequestWithTracing
@Deprecated(forRemoval=true) public org.opensearch.client.Response performRequestWithTracing(org.opensearch.client.Request request) Deprecated, for removal: This API element is subject to removal in a future version.Performs an OpenSearch request using the low level client, exposed since 11.5 for internal use only. -
index
public org.opensearch.action.index.IndexResponse index(org.opensearch.action.index.IndexRequest request) - Specified by:
indexin interfaceOpenSearchClient
-
doIndex
protected org.opensearch.action.index.IndexResponse doIndex(org.opensearch.action.index.IndexRequest request) throws RetryableException - Throws:
RetryableException
-
bulk
public org.opensearch.action.bulk.BulkResponse bulk(org.opensearch.action.bulk.BulkRequest request) - Specified by:
bulkin interfaceOpenSearchClient
-
doBulk
protected org.opensearch.action.bulk.BulkResponse doBulk(org.opensearch.action.bulk.BulkRequest request) throws RetryableException - Throws:
RetryableException
-
get
public org.opensearch.action.get.GetResponse get(org.opensearch.action.get.GetRequest request) - Specified by:
getin interfaceOpenSearchClient
-
search
public org.opensearch.action.search.SearchResponse search(org.opensearch.action.search.SearchRequest request) - Specified by:
searchin interfaceOpenSearchClient
-
scroll
public org.opensearch.action.search.SearchResponse scroll(org.opensearch.action.search.SearchScrollRequest request) - Specified by:
scrollin interfaceOpenSearchClient
-
clearScroll
public org.opensearch.action.search.ClearScrollResponse clearScroll(org.opensearch.action.search.ClearScrollRequest request) - Specified by:
clearScrollin interfaceOpenSearchClient
-
performRequestWithTracing
protected <I extends org.opensearch.action.ActionRequest,O extends org.opensearch.action.ActionResponse> O performRequestWithTracing(ThrowableBiFunction<I, org.opensearch.client.RequestOptions, O, IOException> runner, I request, String spanName) -
getScopedSpan
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
LONG_TIMEOUTinstead