co.elastic.clients.elasticsearch.ElasticsearchClient Maven / Gradle / Ivy
Show all versions of elasticsearch-java Show documentation
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package co.elastic.clients.elasticsearch;
import co.elastic.clients.ApiClient;
import co.elastic.clients.elasticsearch._types.ElasticsearchException;
import co.elastic.clients.elasticsearch._types.ErrorResponse;
import co.elastic.clients.elasticsearch.async_search.ElasticsearchAsyncSearchClient;
import co.elastic.clients.elasticsearch.autoscaling.ElasticsearchAutoscalingClient;
import co.elastic.clients.elasticsearch.cat.ElasticsearchCatClient;
import co.elastic.clients.elasticsearch.ccr.ElasticsearchCcrClient;
import co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterClient;
import co.elastic.clients.elasticsearch.core.BulkRequest;
import co.elastic.clients.elasticsearch.core.BulkResponse;
import co.elastic.clients.elasticsearch.core.ClearScrollRequest;
import co.elastic.clients.elasticsearch.core.ClearScrollResponse;
import co.elastic.clients.elasticsearch.core.ClosePointInTimeRequest;
import co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse;
import co.elastic.clients.elasticsearch.core.CountRequest;
import co.elastic.clients.elasticsearch.core.CountResponse;
import co.elastic.clients.elasticsearch.core.CreateRequest;
import co.elastic.clients.elasticsearch.core.CreateResponse;
import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest;
import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse;
import co.elastic.clients.elasticsearch.core.DeleteByQueryRethrottleRequest;
import co.elastic.clients.elasticsearch.core.DeleteByQueryRethrottleResponse;
import co.elastic.clients.elasticsearch.core.DeleteRequest;
import co.elastic.clients.elasticsearch.core.DeleteResponse;
import co.elastic.clients.elasticsearch.core.DeleteScriptRequest;
import co.elastic.clients.elasticsearch.core.DeleteScriptResponse;
import co.elastic.clients.elasticsearch.core.ExistsRequest;
import co.elastic.clients.elasticsearch.core.ExistsSourceRequest;
import co.elastic.clients.elasticsearch.core.ExplainRequest;
import co.elastic.clients.elasticsearch.core.ExplainResponse;
import co.elastic.clients.elasticsearch.core.FieldCapsRequest;
import co.elastic.clients.elasticsearch.core.FieldCapsResponse;
import co.elastic.clients.elasticsearch.core.GetRequest;
import co.elastic.clients.elasticsearch.core.GetResponse;
import co.elastic.clients.elasticsearch.core.GetScriptContextRequest;
import co.elastic.clients.elasticsearch.core.GetScriptContextResponse;
import co.elastic.clients.elasticsearch.core.GetScriptLanguagesRequest;
import co.elastic.clients.elasticsearch.core.GetScriptLanguagesResponse;
import co.elastic.clients.elasticsearch.core.GetScriptRequest;
import co.elastic.clients.elasticsearch.core.GetScriptResponse;
import co.elastic.clients.elasticsearch.core.GetSourceRequest;
import co.elastic.clients.elasticsearch.core.GetSourceResponse;
import co.elastic.clients.elasticsearch.core.HealthReportRequest;
import co.elastic.clients.elasticsearch.core.HealthReportResponse;
import co.elastic.clients.elasticsearch.core.IndexRequest;
import co.elastic.clients.elasticsearch.core.IndexResponse;
import co.elastic.clients.elasticsearch.core.InfoRequest;
import co.elastic.clients.elasticsearch.core.InfoResponse;
import co.elastic.clients.elasticsearch.core.KnnSearchRequest;
import co.elastic.clients.elasticsearch.core.KnnSearchResponse;
import co.elastic.clients.elasticsearch.core.MgetRequest;
import co.elastic.clients.elasticsearch.core.MgetResponse;
import co.elastic.clients.elasticsearch.core.MsearchRequest;
import co.elastic.clients.elasticsearch.core.MsearchResponse;
import co.elastic.clients.elasticsearch.core.MsearchTemplateRequest;
import co.elastic.clients.elasticsearch.core.MsearchTemplateResponse;
import co.elastic.clients.elasticsearch.core.MtermvectorsRequest;
import co.elastic.clients.elasticsearch.core.MtermvectorsResponse;
import co.elastic.clients.elasticsearch.core.OpenPointInTimeRequest;
import co.elastic.clients.elasticsearch.core.OpenPointInTimeResponse;
import co.elastic.clients.elasticsearch.core.PingRequest;
import co.elastic.clients.elasticsearch.core.PutScriptRequest;
import co.elastic.clients.elasticsearch.core.PutScriptResponse;
import co.elastic.clients.elasticsearch.core.RankEvalRequest;
import co.elastic.clients.elasticsearch.core.RankEvalResponse;
import co.elastic.clients.elasticsearch.core.ReindexRequest;
import co.elastic.clients.elasticsearch.core.ReindexResponse;
import co.elastic.clients.elasticsearch.core.ReindexRethrottleRequest;
import co.elastic.clients.elasticsearch.core.ReindexRethrottleResponse;
import co.elastic.clients.elasticsearch.core.RenderSearchTemplateRequest;
import co.elastic.clients.elasticsearch.core.RenderSearchTemplateResponse;
import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteRequest;
import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse;
import co.elastic.clients.elasticsearch.core.ScrollRequest;
import co.elastic.clients.elasticsearch.core.ScrollResponse;
import co.elastic.clients.elasticsearch.core.SearchMvtRequest;
import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.elasticsearch.core.SearchShardsRequest;
import co.elastic.clients.elasticsearch.core.SearchShardsResponse;
import co.elastic.clients.elasticsearch.core.SearchTemplateRequest;
import co.elastic.clients.elasticsearch.core.SearchTemplateResponse;
import co.elastic.clients.elasticsearch.core.TermsEnumRequest;
import co.elastic.clients.elasticsearch.core.TermsEnumResponse;
import co.elastic.clients.elasticsearch.core.TermvectorsRequest;
import co.elastic.clients.elasticsearch.core.TermvectorsResponse;
import co.elastic.clients.elasticsearch.core.UpdateByQueryRequest;
import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse;
import co.elastic.clients.elasticsearch.core.UpdateByQueryRethrottleRequest;
import co.elastic.clients.elasticsearch.core.UpdateByQueryRethrottleResponse;
import co.elastic.clients.elasticsearch.core.UpdateRequest;
import co.elastic.clients.elasticsearch.core.UpdateResponse;
import co.elastic.clients.elasticsearch.dangling_indices.ElasticsearchDanglingIndicesClient;
import co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichClient;
import co.elastic.clients.elasticsearch.eql.ElasticsearchEqlClient;
import co.elastic.clients.elasticsearch.esql.ElasticsearchEsqlClient;
import co.elastic.clients.elasticsearch.features.ElasticsearchFeaturesClient;
import co.elastic.clients.elasticsearch.fleet.ElasticsearchFleetClient;
import co.elastic.clients.elasticsearch.graph.ElasticsearchGraphClient;
import co.elastic.clients.elasticsearch.ilm.ElasticsearchIlmClient;
import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient;
import co.elastic.clients.elasticsearch.inference.ElasticsearchInferenceClient;
import co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestClient;
import co.elastic.clients.elasticsearch.license.ElasticsearchLicenseClient;
import co.elastic.clients.elasticsearch.logstash.ElasticsearchLogstashClient;
import co.elastic.clients.elasticsearch.migration.ElasticsearchMigrationClient;
import co.elastic.clients.elasticsearch.ml.ElasticsearchMlClient;
import co.elastic.clients.elasticsearch.monitoring.ElasticsearchMonitoringClient;
import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesClient;
import co.elastic.clients.elasticsearch.query_ruleset.ElasticsearchQueryRulesetClient;
import co.elastic.clients.elasticsearch.rollup.ElasticsearchRollupClient;
import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationClient;
import co.elastic.clients.elasticsearch.searchable_snapshots.ElasticsearchSearchableSnapshotsClient;
import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityClient;
import co.elastic.clients.elasticsearch.shutdown.ElasticsearchShutdownClient;
import co.elastic.clients.elasticsearch.slm.ElasticsearchSlmClient;
import co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotClient;
import co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient;
import co.elastic.clients.elasticsearch.ssl.ElasticsearchSslClient;
import co.elastic.clients.elasticsearch.synonyms.ElasticsearchSynonymsClient;
import co.elastic.clients.elasticsearch.tasks.ElasticsearchTasksClient;
import co.elastic.clients.elasticsearch.text_structure.ElasticsearchTextStructureClient;
import co.elastic.clients.elasticsearch.transform.ElasticsearchTransformClient;
import co.elastic.clients.elasticsearch.watcher.ElasticsearchWatcherClient;
import co.elastic.clients.elasticsearch.xpack.ElasticsearchXpackClient;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.Endpoint;
import co.elastic.clients.transport.JsonEndpoint;
import co.elastic.clients.transport.Transport;
import co.elastic.clients.transport.TransportOptions;
import co.elastic.clients.transport.endpoints.BinaryResponse;
import co.elastic.clients.transport.endpoints.BooleanResponse;
import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr;
import co.elastic.clients.util.ObjectBuilder;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.function.Function;
import javax.annotation.Nullable;
//----------------------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------
/**
* Client for the namespace.
*/
public class ElasticsearchClient extends ApiClient {
public ElasticsearchClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchClient(this.transport, transportOptions);
}
// ----- Child clients
public ElasticsearchAsyncSearchClient asyncSearch() {
return new ElasticsearchAsyncSearchClient(this.transport, this.transportOptions);
}
public ElasticsearchAutoscalingClient autoscaling() {
return new ElasticsearchAutoscalingClient(this.transport, this.transportOptions);
}
public ElasticsearchCatClient cat() {
return new ElasticsearchCatClient(this.transport, this.transportOptions);
}
public ElasticsearchCcrClient ccr() {
return new ElasticsearchCcrClient(this.transport, this.transportOptions);
}
public ElasticsearchClusterClient cluster() {
return new ElasticsearchClusterClient(this.transport, this.transportOptions);
}
public ElasticsearchDanglingIndicesClient danglingIndices() {
return new ElasticsearchDanglingIndicesClient(this.transport, this.transportOptions);
}
public ElasticsearchEnrichClient enrich() {
return new ElasticsearchEnrichClient(this.transport, this.transportOptions);
}
public ElasticsearchEqlClient eql() {
return new ElasticsearchEqlClient(this.transport, this.transportOptions);
}
public ElasticsearchEsqlClient esql() {
return new ElasticsearchEsqlClient(this.transport, this.transportOptions);
}
public ElasticsearchFeaturesClient features() {
return new ElasticsearchFeaturesClient(this.transport, this.transportOptions);
}
public ElasticsearchFleetClient fleet() {
return new ElasticsearchFleetClient(this.transport, this.transportOptions);
}
public ElasticsearchGraphClient graph() {
return new ElasticsearchGraphClient(this.transport, this.transportOptions);
}
public ElasticsearchIlmClient ilm() {
return new ElasticsearchIlmClient(this.transport, this.transportOptions);
}
public ElasticsearchIndicesClient indices() {
return new ElasticsearchIndicesClient(this.transport, this.transportOptions);
}
public ElasticsearchInferenceClient inference() {
return new ElasticsearchInferenceClient(this.transport, this.transportOptions);
}
public ElasticsearchIngestClient ingest() {
return new ElasticsearchIngestClient(this.transport, this.transportOptions);
}
public ElasticsearchLicenseClient license() {
return new ElasticsearchLicenseClient(this.transport, this.transportOptions);
}
public ElasticsearchLogstashClient logstash() {
return new ElasticsearchLogstashClient(this.transport, this.transportOptions);
}
public ElasticsearchMigrationClient migration() {
return new ElasticsearchMigrationClient(this.transport, this.transportOptions);
}
public ElasticsearchMlClient ml() {
return new ElasticsearchMlClient(this.transport, this.transportOptions);
}
public ElasticsearchMonitoringClient monitoring() {
return new ElasticsearchMonitoringClient(this.transport, this.transportOptions);
}
public ElasticsearchNodesClient nodes() {
return new ElasticsearchNodesClient(this.transport, this.transportOptions);
}
public ElasticsearchQueryRulesetClient queryRuleset() {
return new ElasticsearchQueryRulesetClient(this.transport, this.transportOptions);
}
public ElasticsearchRollupClient rollup() {
return new ElasticsearchRollupClient(this.transport, this.transportOptions);
}
public ElasticsearchSearchApplicationClient searchApplication() {
return new ElasticsearchSearchApplicationClient(this.transport, this.transportOptions);
}
public ElasticsearchSearchableSnapshotsClient searchableSnapshots() {
return new ElasticsearchSearchableSnapshotsClient(this.transport, this.transportOptions);
}
public ElasticsearchSecurityClient security() {
return new ElasticsearchSecurityClient(this.transport, this.transportOptions);
}
public ElasticsearchShutdownClient shutdown() {
return new ElasticsearchShutdownClient(this.transport, this.transportOptions);
}
public ElasticsearchSlmClient slm() {
return new ElasticsearchSlmClient(this.transport, this.transportOptions);
}
public ElasticsearchSnapshotClient snapshot() {
return new ElasticsearchSnapshotClient(this.transport, this.transportOptions);
}
public ElasticsearchSqlClient sql() {
return new ElasticsearchSqlClient(this.transport, this.transportOptions);
}
public ElasticsearchSslClient ssl() {
return new ElasticsearchSslClient(this.transport, this.transportOptions);
}
public ElasticsearchSynonymsClient synonyms() {
return new ElasticsearchSynonymsClient(this.transport, this.transportOptions);
}
public ElasticsearchTasksClient tasks() {
return new ElasticsearchTasksClient(this.transport, this.transportOptions);
}
public ElasticsearchTextStructureClient textStructure() {
return new ElasticsearchTextStructureClient(this.transport, this.transportOptions);
}
public ElasticsearchTransformClient transform() {
return new ElasticsearchTransformClient(this.transport, this.transportOptions);
}
public ElasticsearchWatcherClient watcher() {
return new ElasticsearchWatcherClient(this.transport, this.transportOptions);
}
public ElasticsearchXpackClient xpack() {
return new ElasticsearchXpackClient(this.transport, this.transportOptions);
}
// ----- Endpoint: bulk
/**
* Allows to perform multiple index/update/delete operations in a single
* request.
*
* @see Documentation
* on elastic.co
*/
public BulkResponse bulk(BulkRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) BulkRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to perform multiple index/update/delete operations in a single
* request.
*
* @param fn
* a function that initializes a builder to create the
* {@link BulkRequest}
* @see Documentation
* on elastic.co
*/
public final BulkResponse bulk(Function> fn)
throws IOException, ElasticsearchException {
return bulk(fn.apply(new BulkRequest.Builder()).build());
}
/**
* Allows to perform multiple index/update/delete operations in a single
* request.
*
* @see Documentation
* on elastic.co
*/
public BulkResponse bulk() throws IOException, ElasticsearchException {
return this.transport.performRequest(new BulkRequest.Builder().build(), BulkRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: clear_scroll
/**
* Explicitly clears the search context for a scroll.
*
* @see Documentation
* on elastic.co
*/
public ClearScrollResponse clearScroll(ClearScrollRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClearScrollRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Explicitly clears the search context for a scroll.
*
* @param fn
* a function that initializes a builder to create the
* {@link ClearScrollRequest}
* @see Documentation
* on elastic.co
*/
public final ClearScrollResponse clearScroll(
Function> fn)
throws IOException, ElasticsearchException {
return clearScroll(fn.apply(new ClearScrollRequest.Builder()).build());
}
/**
* Explicitly clears the search context for a scroll.
*
* @see Documentation
* on elastic.co
*/
public ClearScrollResponse clearScroll() throws IOException, ElasticsearchException {
return this.transport.performRequest(new ClearScrollRequest.Builder().build(), ClearScrollRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: close_point_in_time
/**
* Close a point in time
*
* @see Documentation
* on elastic.co
*/
public ClosePointInTimeResponse closePointInTime(ClosePointInTimeRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ClosePointInTimeRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Close a point in time
*
* @param fn
* a function that initializes a builder to create the
* {@link ClosePointInTimeRequest}
* @see Documentation
* on elastic.co
*/
public final ClosePointInTimeResponse closePointInTime(
Function> fn)
throws IOException, ElasticsearchException {
return closePointInTime(fn.apply(new ClosePointInTimeRequest.Builder()).build());
}
// ----- Endpoint: count
/**
* Returns number of documents matching a query.
*
* @see Documentation
* on elastic.co
*/
public CountResponse count(CountRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) CountRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns number of documents matching a query.
*
* @param fn
* a function that initializes a builder to create the
* {@link CountRequest}
* @see Documentation
* on elastic.co
*/
public final CountResponse count(Function> fn)
throws IOException, ElasticsearchException {
return count(fn.apply(new CountRequest.Builder()).build());
}
/**
* Returns number of documents matching a query.
*
* @see Documentation
* on elastic.co
*/
public CountResponse count() throws IOException, ElasticsearchException {
return this.transport.performRequest(new CountRequest.Builder().build(), CountRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: create
/**
* Creates a new document in the index.
*
* Returns a 409 response when a document with a same ID already exists in the
* index.
*
* @see Documentation
* on elastic.co
*/
public CreateResponse create(CreateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, CreateResponse, ErrorResponse> endpoint = (JsonEndpoint, CreateResponse, ErrorResponse>) CreateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates a new document in the index.
*
* Returns a 409 response when a document with a same ID already exists in the
* index.
*
* @param fn
* a function that initializes a builder to create the
* {@link CreateRequest}
* @see Documentation
* on elastic.co
*/
public final CreateResponse create(
Function, ObjectBuilder>> fn)
throws IOException, ElasticsearchException {
return create(fn.apply(new CreateRequest.Builder()).build());
}
// ----- Endpoint: delete
/**
* Removes a document from the index.
*
* @see Documentation
* on elastic.co
*/
public DeleteResponse delete(DeleteRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Removes a document from the index.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteResponse delete(Function> fn)
throws IOException, ElasticsearchException {
return delete(fn.apply(new DeleteRequest.Builder()).build());
}
// ----- Endpoint: delete_by_query
/**
* Deletes documents matching the provided query.
*
* @see Documentation
* on elastic.co
*/
public DeleteByQueryResponse deleteByQuery(DeleteByQueryRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteByQueryRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Deletes documents matching the provided query.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteByQueryRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteByQueryResponse deleteByQuery(
Function> fn)
throws IOException, ElasticsearchException {
return deleteByQuery(fn.apply(new DeleteByQueryRequest.Builder()).build());
}
// ----- Endpoint: delete_by_query_rethrottle
/**
* Changes the number of requests per second for a particular Delete By Query
* operation.
*
* @see Documentation
* on elastic.co
*/
public DeleteByQueryRethrottleResponse deleteByQueryRethrottle(DeleteByQueryRethrottleRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteByQueryRethrottleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Changes the number of requests per second for a particular Delete By Query
* operation.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteByQueryRethrottleRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteByQueryRethrottleResponse deleteByQueryRethrottle(
Function> fn)
throws IOException, ElasticsearchException {
return deleteByQueryRethrottle(fn.apply(new DeleteByQueryRethrottleRequest.Builder()).build());
}
// ----- Endpoint: delete_script
/**
* Deletes a script.
*
* @see Documentation
* on elastic.co
*/
public DeleteScriptResponse deleteScript(DeleteScriptRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeleteScriptRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Deletes a script.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeleteScriptRequest}
* @see Documentation
* on elastic.co
*/
public final DeleteScriptResponse deleteScript(
Function> fn)
throws IOException, ElasticsearchException {
return deleteScript(fn.apply(new DeleteScriptRequest.Builder()).build());
}
// ----- Endpoint: exists
/**
* Returns information about whether a document exists in an index.
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about whether a document exists in an index.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExistsRequest}
* @see Documentation
* on elastic.co
*/
public final BooleanResponse exists(Function> fn)
throws IOException, ElasticsearchException {
return exists(fn.apply(new ExistsRequest.Builder()).build());
}
// ----- Endpoint: exists_source
/**
* Returns information about whether a document source exists in an index.
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse existsSource(ExistsSourceRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint endpoint = (Endpoint) ExistsSourceRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about whether a document source exists in an index.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExistsSourceRequest}
* @see Documentation
* on elastic.co
*/
public final BooleanResponse existsSource(
Function> fn)
throws IOException, ElasticsearchException {
return existsSource(fn.apply(new ExistsSourceRequest.Builder()).build());
}
// ----- Endpoint: explain
/**
* Returns information about why a specific matches (or doesn't match) a query.
*
* @see Documentation
* on elastic.co
*/
public ExplainResponse explain(ExplainRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.explain.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about why a specific matches (or doesn't match) a query.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExplainRequest}
* @see Documentation
* on elastic.co
*/
public final ExplainResponse explain(
Function> fn, Class tDocumentClass)
throws IOException, ElasticsearchException {
return explain(fn.apply(new ExplainRequest.Builder()).build(), tDocumentClass);
}
/**
* Returns information about why a specific matches (or doesn't match) a query.
*
* @see Documentation
* on elastic.co
*/
public ExplainResponse explain(ExplainRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.explain.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about why a specific matches (or doesn't match) a query.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExplainRequest}
* @see Documentation
* on elastic.co
*/
public final ExplainResponse explain(
Function> fn, Type tDocumentType)
throws IOException, ElasticsearchException {
return explain(fn.apply(new ExplainRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: field_caps
/**
* Returns the information about the capabilities of fields among multiple
* indices.
*
* @see Documentation
* on elastic.co
*/
public FieldCapsResponse fieldCaps(FieldCapsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) FieldCapsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns the information about the capabilities of fields among multiple
* indices.
*
* @param fn
* a function that initializes a builder to create the
* {@link FieldCapsRequest}
* @see Documentation
* on elastic.co
*/
public final FieldCapsResponse fieldCaps(Function> fn)
throws IOException, ElasticsearchException {
return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build());
}
/**
* Returns the information about the capabilities of fields among multiple
* indices.
*
* @see Documentation
* on elastic.co
*/
public FieldCapsResponse fieldCaps() throws IOException, ElasticsearchException {
return this.transport.performRequest(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: get
/**
* Returns a document.
*
* @see Documentation
* on elastic.co
*/
public GetResponse get(GetRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns a document.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetRequest}
* @see Documentation
* on elastic.co
*/
public final GetResponse get(Function> fn,
Class tDocumentClass) throws IOException, ElasticsearchException {
return get(fn.apply(new GetRequest.Builder()).build(), tDocumentClass);
}
/**
* Returns a document.
*
* @see Documentation
* on elastic.co
*/
public GetResponse get(GetRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns a document.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetRequest}
* @see Documentation
* on elastic.co
*/
public final GetResponse get(Function> fn,
Type tDocumentType) throws IOException, ElasticsearchException {
return get(fn.apply(new GetRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: get_script
/**
* Returns a script.
*
* @see Documentation
* on elastic.co
*/
public GetScriptResponse getScript(GetScriptRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetScriptRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns a script.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetScriptRequest}
* @see Documentation
* on elastic.co
*/
public final GetScriptResponse getScript(Function> fn)
throws IOException, ElasticsearchException {
return getScript(fn.apply(new GetScriptRequest.Builder()).build());
}
// ----- Endpoint: get_script_context
/**
* Returns all script contexts.
*
* @see Documentation
* on elastic.co
*/
public GetScriptContextResponse getScriptContext() throws IOException, ElasticsearchException {
return this.transport.performRequest(GetScriptContextRequest._INSTANCE, GetScriptContextRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: get_script_languages
/**
* Returns available script types, languages and contexts
*
* @see Documentation
* on elastic.co
*/
public GetScriptLanguagesResponse getScriptLanguages() throws IOException, ElasticsearchException {
return this.transport.performRequest(GetScriptLanguagesRequest._INSTANCE, GetScriptLanguagesRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: get_source
/**
* Returns the source of a document.
*
* @see Documentation
* on elastic.co
*/
public GetSourceResponse getSource(GetSourceRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns the source of a document.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetSourceRequest}
* @see Documentation
* on elastic.co
*/
public final GetSourceResponse getSource(
Function> fn, Class tDocumentClass)
throws IOException, ElasticsearchException {
return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentClass);
}
/**
* Returns the source of a document.
*
* @see Documentation
* on elastic.co
*/
public GetSourceResponse getSource(GetSourceRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns the source of a document.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetSourceRequest}
* @see Documentation
* on elastic.co
*/
public final GetSourceResponse getSource(
Function> fn, Type tDocumentType)
throws IOException, ElasticsearchException {
return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: health_report
/**
* Returns the health of the cluster.
*
* @see Documentation
* on elastic.co
*/
public HealthReportResponse healthReport(HealthReportRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) HealthReportRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns the health of the cluster.
*
* @param fn
* a function that initializes a builder to create the
* {@link HealthReportRequest}
* @see Documentation
* on elastic.co
*/
public final HealthReportResponse healthReport(
Function> fn)
throws IOException, ElasticsearchException {
return healthReport(fn.apply(new HealthReportRequest.Builder()).build());
}
/**
* Returns the health of the cluster.
*
* @see Documentation
* on elastic.co
*/
public HealthReportResponse healthReport() throws IOException, ElasticsearchException {
return this.transport.performRequest(new HealthReportRequest.Builder().build(), HealthReportRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: index
/**
* Creates or updates a document in an index.
*
* @see Documentation
* on elastic.co
*/
public IndexResponse index(IndexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, IndexResponse, ErrorResponse> endpoint = (JsonEndpoint, IndexResponse, ErrorResponse>) IndexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates or updates a document in an index.
*
* @param fn
* a function that initializes a builder to create the
* {@link IndexRequest}
* @see Documentation
* on elastic.co
*/
public final IndexResponse index(
Function, ObjectBuilder>> fn)
throws IOException, ElasticsearchException {
return index(fn.apply(new IndexRequest.Builder()).build());
}
// ----- Endpoint: info
/**
* Returns basic information about the cluster.
*
* @see Documentation
* on elastic.co
*/
public InfoResponse info() throws IOException, ElasticsearchException {
return this.transport.performRequest(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: knn_search
/**
* Performs a kNN search.
*
* @see Documentation
* on elastic.co
*/
public KnnSearchResponse knnSearch(KnnSearchRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) KnnSearchRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.knn_search.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Performs a kNN search.
*
* @param fn
* a function that initializes a builder to create the
* {@link KnnSearchRequest}
* @see Documentation
* on elastic.co
*/
public final KnnSearchResponse knnSearch(
Function> fn, Class tDocumentClass)
throws IOException, ElasticsearchException {
return knnSearch(fn.apply(new KnnSearchRequest.Builder()).build(), tDocumentClass);
}
/**
* Performs a kNN search.
*
* @see Documentation
* on elastic.co
*/
public KnnSearchResponse knnSearch(KnnSearchRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) KnnSearchRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.knn_search.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Performs a kNN search.
*
* @param fn
* a function that initializes a builder to create the
* {@link KnnSearchRequest}
* @see Documentation
* on elastic.co
*/
public final KnnSearchResponse knnSearch(
Function> fn, Type tDocumentType)
throws IOException, ElasticsearchException {
return knnSearch(fn.apply(new KnnSearchRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: mget
/**
* Allows to get multiple documents in one request.
*
* @see Documentation
* on elastic.co
*/
public MgetResponse mget(MgetRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to get multiple documents in one request.
*
* @param fn
* a function that initializes a builder to create the
* {@link MgetRequest}
* @see Documentation
* on elastic.co
*/
public final MgetResponse mget(Function> fn,
Class tDocumentClass) throws IOException, ElasticsearchException {
return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentClass);
}
/**
* Allows to get multiple documents in one request.
*
* @see Documentation
* on elastic.co
*/
public MgetResponse mget(MgetRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to get multiple documents in one request.
*
* @param fn
* a function that initializes a builder to create the
* {@link MgetRequest}
* @see Documentation
* on elastic.co
*/
public final MgetResponse mget(Function> fn,
Type tDocumentType) throws IOException, ElasticsearchException {
return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: msearch
/**
* Allows to execute several search operations in one request.
*
* @see Documentation
* on elastic.co
*/
public MsearchResponse msearch(MsearchRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to execute several search operations in one request.
*
* @param fn
* a function that initializes a builder to create the
* {@link MsearchRequest}
* @see Documentation
* on elastic.co
*/
public final MsearchResponse msearch(
Function> fn, Class tDocumentClass)
throws IOException, ElasticsearchException {
return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentClass);
}
/**
* Allows to execute several search operations in one request.
*
* @see Documentation
* on elastic.co
*/
public MsearchResponse msearch(MsearchRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to execute several search operations in one request.
*
* @param fn
* a function that initializes a builder to create the
* {@link MsearchRequest}
* @see Documentation
* on elastic.co
*/
public final MsearchResponse msearch(
Function> fn, Type tDocumentType)
throws IOException, ElasticsearchException {
return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: msearch_template
/**
* Allows to execute several search template operations in one request.
*
* @see Documentation
* on elastic.co
*/
public MsearchTemplateResponse msearchTemplate(MsearchTemplateRequest request,
Class tDocumentClass) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to execute several search template operations in one request.
*
* @param fn
* a function that initializes a builder to create the
* {@link MsearchTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final MsearchTemplateResponse msearchTemplate(
Function> fn,
Class tDocumentClass) throws IOException, ElasticsearchException {
return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentClass);
}
/**
* Allows to execute several search template operations in one request.
*
* @see Documentation
* on elastic.co
*/
public MsearchTemplateResponse msearchTemplate(MsearchTemplateRequest request,
Type tDocumentType) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to execute several search template operations in one request.
*
* @param fn
* a function that initializes a builder to create the
* {@link MsearchTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final MsearchTemplateResponse msearchTemplate(
Function> fn, Type tDocumentType)
throws IOException, ElasticsearchException {
return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: mtermvectors
/**
* Returns multiple termvectors in one request.
*
* @see Documentation
* on elastic.co
*/
public MtermvectorsResponse mtermvectors(MtermvectorsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) MtermvectorsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns multiple termvectors in one request.
*
* @param fn
* a function that initializes a builder to create the
* {@link MtermvectorsRequest}
* @see Documentation
* on elastic.co
*/
public final MtermvectorsResponse mtermvectors(
Function> fn)
throws IOException, ElasticsearchException {
return mtermvectors(fn.apply(new MtermvectorsRequest.Builder()).build());
}
/**
* Returns multiple termvectors in one request.
*
* @see Documentation
* on elastic.co
*/
public MtermvectorsResponse mtermvectors() throws IOException, ElasticsearchException {
return this.transport.performRequest(new MtermvectorsRequest.Builder().build(), MtermvectorsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: open_point_in_time
/**
* Open a point in time that can be used in subsequent searches
*
* @see Documentation
* on elastic.co
*/
public OpenPointInTimeResponse openPointInTime(OpenPointInTimeRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) OpenPointInTimeRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Open a point in time that can be used in subsequent searches
*
* @param fn
* a function that initializes a builder to create the
* {@link OpenPointInTimeRequest}
* @see Documentation
* on elastic.co
*/
public final OpenPointInTimeResponse openPointInTime(
Function> fn)
throws IOException, ElasticsearchException {
return openPointInTime(fn.apply(new OpenPointInTimeRequest.Builder()).build());
}
// ----- Endpoint: ping
/**
* Returns whether the cluster is running.
*
* @see Documentation
* on elastic.co
*/
public BooleanResponse ping() throws IOException, ElasticsearchException {
return this.transport.performRequest(PingRequest._INSTANCE, PingRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: put_script
/**
* Creates or updates a script.
*
* @see Documentation
* on elastic.co
*/
public PutScriptResponse putScript(PutScriptRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutScriptRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Creates or updates a script.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutScriptRequest}
* @see Documentation
* on elastic.co
*/
public final PutScriptResponse putScript(Function> fn)
throws IOException, ElasticsearchException {
return putScript(fn.apply(new PutScriptRequest.Builder()).build());
}
// ----- Endpoint: rank_eval
/**
* Allows to evaluate the quality of ranked search results over a set of typical
* search queries
*
* @see Documentation
* on elastic.co
*/
public RankEvalResponse rankEval(RankEvalRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) RankEvalRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to evaluate the quality of ranked search results over a set of typical
* search queries
*
* @param fn
* a function that initializes a builder to create the
* {@link RankEvalRequest}
* @see Documentation
* on elastic.co
*/
public final RankEvalResponse rankEval(Function> fn)
throws IOException, ElasticsearchException {
return rankEval(fn.apply(new RankEvalRequest.Builder()).build());
}
// ----- Endpoint: reindex
/**
* Allows to copy documents from one index to another, optionally filtering the
* source documents by a query, changing the destination index settings, or
* fetching the documents from a remote cluster.
*
* @see Documentation
* on elastic.co
*/
public ReindexResponse reindex(ReindexRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ReindexRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to copy documents from one index to another, optionally filtering the
* source documents by a query, changing the destination index settings, or
* fetching the documents from a remote cluster.
*
* @param fn
* a function that initializes a builder to create the
* {@link ReindexRequest}
* @see Documentation
* on elastic.co
*/
public final ReindexResponse reindex(Function> fn)
throws IOException, ElasticsearchException {
return reindex(fn.apply(new ReindexRequest.Builder()).build());
}
// ----- Endpoint: reindex_rethrottle
/**
* Changes the number of requests per second for a particular Reindex operation.
*
* @see Documentation
* on elastic.co
*/
public ReindexRethrottleResponse reindexRethrottle(ReindexRethrottleRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ReindexRethrottleRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Changes the number of requests per second for a particular Reindex operation.
*
* @param fn
* a function that initializes a builder to create the
* {@link ReindexRethrottleRequest}
* @see Documentation
* on elastic.co
*/
public final ReindexRethrottleResponse reindexRethrottle(
Function> fn)
throws IOException, ElasticsearchException {
return reindexRethrottle(fn.apply(new ReindexRethrottleRequest.Builder()).build());
}
// ----- Endpoint: render_search_template
/**
* Allows to use the Mustache language to pre-render a search definition.
*
* @see Documentation
* on elastic.co
*/
public RenderSearchTemplateResponse renderSearchTemplate(RenderSearchTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) RenderSearchTemplateRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to use the Mustache language to pre-render a search definition.
*
* @param fn
* a function that initializes a builder to create the
* {@link RenderSearchTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final RenderSearchTemplateResponse renderSearchTemplate(
Function> fn)
throws IOException, ElasticsearchException {
return renderSearchTemplate(fn.apply(new RenderSearchTemplateRequest.Builder()).build());
}
/**
* Allows to use the Mustache language to pre-render a search definition.
*
* @see Documentation
* on elastic.co
*/
public RenderSearchTemplateResponse renderSearchTemplate() throws IOException, ElasticsearchException {
return this.transport.performRequest(new RenderSearchTemplateRequest.Builder().build(),
RenderSearchTemplateRequest._ENDPOINT, this.transportOptions);
}
// ----- Endpoint: scripts_painless_execute
/**
* Allows an arbitrary script to be executed and a result to be returned
*
* @see Documentation
* on elastic.co
*/
public ScriptsPainlessExecuteResponse scriptsPainlessExecute(
ScriptsPainlessExecuteRequest request, Class tResultClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult",
getDeserializer(tResultClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows an arbitrary script to be executed and a result to be returned
*
* @param fn
* a function that initializes a builder to create the
* {@link ScriptsPainlessExecuteRequest}
* @see Documentation
* on elastic.co
*/
public final ScriptsPainlessExecuteResponse scriptsPainlessExecute(
Function> fn,
Class tResultClass) throws IOException, ElasticsearchException {
return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultClass);
}
/**
* Allows an arbitrary script to be executed and a result to be returned
*
* @see Documentation
* on elastic.co
*/
public ScriptsPainlessExecuteResponse scriptsPainlessExecute(
ScriptsPainlessExecuteRequest request, Type tResultType) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult",
getDeserializer(tResultType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows an arbitrary script to be executed and a result to be returned
*
* @param fn
* a function that initializes a builder to create the
* {@link ScriptsPainlessExecuteRequest}
* @see Documentation
* on elastic.co
*/
public final ScriptsPainlessExecuteResponse scriptsPainlessExecute(
Function> fn,
Type tResultType) throws IOException, ElasticsearchException {
return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultType);
}
// ----- Endpoint: scroll
/**
* Allows to retrieve a large numbers of results from a single search request.
*
* @see Documentation
* on elastic.co
*/
public ScrollResponse scroll(ScrollRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to retrieve a large numbers of results from a single search request.
*
* @param fn
* a function that initializes a builder to create the
* {@link ScrollRequest}
* @see Documentation
* on elastic.co
*/
public final ScrollResponse scroll(
Function> fn, Class tDocumentClass)
throws IOException, ElasticsearchException {
return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentClass);
}
/**
* Allows to retrieve a large numbers of results from a single search request.
*
* @see Documentation
* on elastic.co
*/
public ScrollResponse scroll(ScrollRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to retrieve a large numbers of results from a single search request.
*
* @param fn
* a function that initializes a builder to create the
* {@link ScrollRequest}
* @see Documentation
* on elastic.co
*/
public final ScrollResponse scroll(
Function> fn, Type tDocumentType)
throws IOException, ElasticsearchException {
return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: search
/**
* Returns results matching a query.
*
* @see Documentation
* on elastic.co
*/
public SearchResponse search(SearchRequest request, Class tDocumentClass)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns results matching a query.
*
* @param fn
* a function that initializes a builder to create the
* {@link SearchRequest}
* @see Documentation
* on elastic.co
*/
public final SearchResponse search(
Function> fn, Class tDocumentClass)
throws IOException, ElasticsearchException {
return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentClass);
}
/**
* Returns results matching a query.
*
* @see Documentation
* on elastic.co
*/
public SearchResponse search(SearchRequest request, Type tDocumentType)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentType));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns results matching a query.
*
* @param fn
* a function that initializes a builder to create the
* {@link SearchRequest}
* @see Documentation
* on elastic.co
*/
public final SearchResponse search(
Function> fn, Type tDocumentType)
throws IOException, ElasticsearchException {
return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentType);
}
// ----- Endpoint: search_mvt
/**
* Searches a vector tile for geospatial values. Returns results as a binary
* Mapbox vector tile.
*
* @see Documentation
* on elastic.co
*/
public BinaryResponse searchMvt(SearchMvtRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint endpoint = (Endpoint) SearchMvtRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Searches a vector tile for geospatial values. Returns results as a binary
* Mapbox vector tile.
*
* @param fn
* a function that initializes a builder to create the
* {@link SearchMvtRequest}
* @see Documentation
* on elastic.co
*/
public final BinaryResponse searchMvt(Function> fn)
throws IOException, ElasticsearchException {
return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build());
}
// ----- Endpoint: search_shards
/**
* Returns information about the indices and shards that a search request would
* be executed against.
*
* @see Documentation
* on elastic.co
*/
public SearchShardsResponse searchShards(SearchShardsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) SearchShardsRequest._ENDPOINT;
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Returns information about the indices and shards that a search request would
* be executed against.
*
* @param fn
* a function that initializes a builder to create the
* {@link SearchShardsRequest}
* @see Documentation
* on elastic.co
*/
public final SearchShardsResponse searchShards(
Function> fn)
throws IOException, ElasticsearchException {
return searchShards(fn.apply(new SearchShardsRequest.Builder()).build());
}
/**
* Returns information about the indices and shards that a search request would
* be executed against.
*
* @see Documentation
* on elastic.co
*/
public SearchShardsResponse searchShards() throws IOException, ElasticsearchException {
return this.transport.performRequest(new SearchShardsRequest.Builder().build(), SearchShardsRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: search_template
/**
* Allows to use the Mustache language to pre-render a search definition.
*
* @see Documentation
* on elastic.co
*/
public SearchTemplateResponse searchTemplate(SearchTemplateRequest request,
Class tDocumentClass) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT;
endpoint = new EndpointWithResponseMapperAttr<>(endpoint,
"co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentClass));
return this.transport.performRequest(request, endpoint, this.transportOptions);
}
/**
* Allows to use the Mustache language to pre-render a search definition.
*
* @param fn
* a function that initializes a builder to create the
* {@link SearchTemplateRequest}
* @see Documentation
* on elastic.co
*/
public final SearchTemplateResponse