Class ElasticsearchSqlClient
java.lang.Object
co.elastic.clients.ApiClient<ElasticsearchTransport,ElasticsearchSqlClient>
co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ElasticsearchSqlClient
extends ApiClient<ElasticsearchTransport,ElasticsearchSqlClient>
Client for the sql namespace.
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchSqlClient
(ElasticsearchTransport transport) ElasticsearchSqlClient
(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptionclearCursor
(ClearCursorRequest request) Clear an SQL search cursor.final ClearCursorResponse
Clear an SQL search cursor.deleteAsync
(DeleteAsyncRequest request) Delete an async SQL search.final DeleteAsyncResponse
Delete an async SQL search.getAsync
(GetAsyncRequest request) Get async SQL search results.final GetAsyncResponse
Get async SQL search results.getAsyncStatus
(GetAsyncStatusRequest request) Get the async SQL search status.final GetAsyncStatusResponse
Get the async SQL search status.query()
Get SQL search results.query
(QueryRequest request) Get SQL search results.final QueryResponse
Get SQL search results.translate
(TranslateRequest request) Translate SQL into Elasticsearch queries.final TranslateResponse
Translate SQL into Elasticsearch queries.withTransportOptions
(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchSqlClient
-
ElasticsearchSqlClient
public ElasticsearchSqlClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
Description copied from class:ApiClient
Creates a new client with some request options- Specified by:
withTransportOptions
in classApiClient<ElasticsearchTransport,
ElasticsearchSqlClient>
-
clearCursor
public ClearCursorResponse clearCursor(ClearCursorRequest request) throws IOException, ElasticsearchException Clear an SQL search cursor.- Throws:
IOException
ElasticsearchException
- See Also:
-
clearCursor
public final ClearCursorResponse clearCursor(Function<ClearCursorRequest.Builder, ObjectBuilder<ClearCursorRequest>> fn) throws IOException, ElasticsearchExceptionClear an SQL search cursor.- Parameters:
fn
- a function that initializes a builder to create theClearCursorRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
deleteAsync
public DeleteAsyncResponse deleteAsync(DeleteAsyncRequest request) throws IOException, ElasticsearchException Delete an async SQL search. Delete an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it.If the Elasticsearch security features are enabled, only the following users can use this API to delete a search:
- Users with the
cancel_task
cluster privilege. - The user who first submitted the search.
- Throws:
IOException
ElasticsearchException
- See Also:
- Users with the
-
deleteAsync
public final DeleteAsyncResponse deleteAsync(Function<DeleteAsyncRequest.Builder, ObjectBuilder<DeleteAsyncRequest>> fn) throws IOException, ElasticsearchExceptionDelete an async SQL search. Delete an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it.If the Elasticsearch security features are enabled, only the following users can use this API to delete a search:
- Users with the
cancel_task
cluster privilege. - The user who first submitted the search.
- Parameters:
fn
- a function that initializes a builder to create theDeleteAsyncRequest
- Throws:
IOException
ElasticsearchException
- See Also:
- Users with the
-
getAsync
public GetAsyncResponse getAsync(GetAsyncRequest request) throws IOException, ElasticsearchException Get async SQL search results. Get the current status and available results for an async SQL search or stored synchronous SQL search.If the Elasticsearch security features are enabled, only the user who first submitted the SQL search can retrieve the search using this API.
- Throws:
IOException
ElasticsearchException
- See Also:
-
getAsync
public final GetAsyncResponse getAsync(Function<GetAsyncRequest.Builder, ObjectBuilder<GetAsyncRequest>> fn) throws IOException, ElasticsearchExceptionGet async SQL search results. Get the current status and available results for an async SQL search or stored synchronous SQL search.If the Elasticsearch security features are enabled, only the user who first submitted the SQL search can retrieve the search using this API.
- Parameters:
fn
- a function that initializes a builder to create theGetAsyncRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
getAsyncStatus
public GetAsyncStatusResponse getAsyncStatus(GetAsyncStatusRequest request) throws IOException, ElasticsearchException Get the async SQL search status. Get the current status of an async SQL search or a stored synchronous SQL search.- Throws:
IOException
ElasticsearchException
- See Also:
-
getAsyncStatus
public final GetAsyncStatusResponse getAsyncStatus(Function<GetAsyncStatusRequest.Builder, ObjectBuilder<GetAsyncStatusRequest>> fn) throws IOException, ElasticsearchExceptionGet the async SQL search status. Get the current status of an async SQL search or a stored synchronous SQL search.- Parameters:
fn
- a function that initializes a builder to create theGetAsyncStatusRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
query
Get SQL search results. Run an SQL request.- Throws:
IOException
ElasticsearchException
- See Also:
-
query
public final QueryResponse query(Function<QueryRequest.Builder, ObjectBuilder<QueryRequest>> fn) throws IOException, ElasticsearchExceptionGet SQL search results. Run an SQL request.- Parameters:
fn
- a function that initializes a builder to create theQueryRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-
query
Get SQL search results. Run an SQL request.- Throws:
IOException
ElasticsearchException
- See Also:
-
translate
public TranslateResponse translate(TranslateRequest request) throws IOException, ElasticsearchException Translate SQL into Elasticsearch queries. Translate an SQL search into a search API request containing Query DSL. It accepts the same request body parameters as the SQL search API, excludingcursor
.- Throws:
IOException
ElasticsearchException
- See Also:
-
translate
public final TranslateResponse translate(Function<TranslateRequest.Builder, ObjectBuilder<TranslateRequest>> fn) throws IOException, ElasticsearchExceptionTranslate SQL into Elasticsearch queries. Translate an SQL search into a search API request containing Query DSL. It accepts the same request body parameters as the SQL search API, excludingcursor
.- Parameters:
fn
- a function that initializes a builder to create theTranslateRequest
- Throws:
IOException
ElasticsearchException
- See Also:
-