diff --git a/Elasticsearch.sln b/Elasticsearch.sln
index 06d9e0d6360..c6feca48733 100644
--- a/Elasticsearch.sln
+++ b/Elasticsearch.sln
@@ -55,6 +55,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.ClusterLauncher", "te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elastic.Clients.Elasticsearch.JsonNetSerializer", "src\Elastic.Clients.Elasticsearch.JsonNetSerializer\Elastic.Clients.Elasticsearch.JsonNetSerializer.csproj", "{8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elastic.Clients.Elasticsearch.Serverless", "src\Elastic.Clients.Elasticsearch.Serverless\Elastic.Clients.Elasticsearch.Serverless.csproj", "{49D7F5A7-AA32-492B-B957-0E3325861F55}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Elastic.Clients.Elasticsearch.Shared", "src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.shproj", "{A90DD7B8-8AFB-4BE9-AA16-B159A880E79D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -209,6 +213,18 @@ Global
{8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|x64.Build.0 = Release|Any CPU
{8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|x86.ActiveCfg = Release|Any CPU
{8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|x86.Build.0 = Release|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x64.Build.0 = Debug|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Debug|x86.Build.0 = Debug|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|Any CPU.Build.0 = Release|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x64.ActiveCfg = Release|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x64.Build.0 = Release|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x86.ActiveCfg = Release|Any CPU
+ {49D7F5A7-AA32-492B-B957-0E3325861F55}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -226,8 +242,15 @@ Global
{68D1BFDC-F447-4D2C-AF81-537807636610} = {1FE49D14-216A-41EE-A177-E42BFF53E0DC}
{F6162603-D134-4121-8106-2BA4DAD7350B} = {362B2776-4B29-46AB-B237-56776B5372B6}
{8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB} = {D455EC79-E1E0-4509-B297-0DA3AED8DFF7}
+ {49D7F5A7-AA32-492B-B957-0E3325861F55} = {D455EC79-E1E0-4509-B297-0DA3AED8DFF7}
+ {A90DD7B8-8AFB-4BE9-AA16-B159A880E79D} = {D455EC79-E1E0-4509-B297-0DA3AED8DFF7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CE74F821-B001-4C69-A58D-CF81F8B0B632}
EndGlobalSection
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.projitems*{49d7f5a7-aa32-492b-b957-0e3325861f55}*SharedItemsImports = 5
+ src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.projitems*{a90dd7b8-8afb-4be9-aa16-b159a880e79d}*SharedItemsImports = 13
+ src\Elastic.Clients.Elasticsearch.Shared\Elastic.Clients.Elasticsearch.Shared.projitems*{f8a7e60c-0c48-4d76-af7f-7881df5a263d}*SharedItemsImports = 5
+ EndGlobalSection
EndGlobal
diff --git a/release.bat b/release.bat
new file mode 100644
index 00000000000..82a6684e6a5
--- /dev/null
+++ b/release.bat
@@ -0,0 +1 @@
+dotnet pack -c Release -o build/output /p:CurrentVersion=1.0.0-preview.1+20231031;CurrentAssemblyVersion=1.0.0;CurrentAssemblyFileVersion=1.0.0
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs b/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs
new file mode 100644
index 00000000000..d32e24670be
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/Client/ElasticsearchClient.cs
@@ -0,0 +1,334 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Elastic.Clients.Elasticsearch.Serverless.Requests;
+using Elastic.Transport;
+using Elastic.Transport.Diagnostics;
+using Elastic.Transport.Products.Elasticsearch;
+
+namespace Elastic.Clients.Elasticsearch.Serverless;
+
+///
+/// A strongly-typed client for communicating with Elasticsearch server endpoints.
+///
+public partial class ElasticsearchClient
+{
+ private const string OpenTelemetrySpanAttributePrefix = "db.elasticsearch.";
+ // This should be updated if any of the code uses semantic conventions defined in newer schema versions.
+ private const string OpenTelemetrySchemaVersion = "https://opentelemetry.io/schemas/1.21.0";
+
+ private readonly HttpTransport _transport;
+ internal static ConditionalWeakTable SettingsTable { get; } = new();
+
+ ///
+ /// Creates a client configured to connect to http://localhost:9200.
+ ///
+ public ElasticsearchClient() : this(new ElasticsearchClientSettings(new Uri("http://localhost:9200"))) { }
+
+ ///
+ /// Creates a client configured to connect to a node reachable at the provided .
+ ///
+ /// The to connect to.
+ public ElasticsearchClient(Uri uri) : this(new ElasticsearchClientSettings(uri)) { }
+
+ ///
+ /// Creates a client configured to communicate with Elastic Cloud using the provided .
+ /// See the documentation for more information on how to obtain your Cloud Id.
+ ///
+ /// If you want more control, use the constructor and
+ /// pass an instance of that takes a in its constructor as well.
+ ///
+ ///
+ /// The Cloud ID of an Elastic Cloud deployment.
+ /// The credentials to use for the connection.
+ public ElasticsearchClient(string cloudId, AuthorizationHeader credentials) : this(
+ new ElasticsearchClientSettings(cloudId, credentials))
+ {
+ }
+
+ ///
+ /// Creates a client using the provided configuration to initialise the client.
+ ///
+ /// The used to configure the client.
+ public ElasticsearchClient(IElasticsearchClientSettings elasticsearchClientSettings)
+ : this(new DefaultHttpTransport(elasticsearchClientSettings))
+ {
+ }
+
+ internal ElasticsearchClient(HttpTransport transport)
+ {
+ transport.ThrowIfNull(nameof(transport));
+ transport.Settings.ThrowIfNull(nameof(transport.Settings));
+ transport.Settings.RequestResponseSerializer.ThrowIfNull(
+ nameof(transport.Settings.RequestResponseSerializer));
+ transport.Settings.Inferrer.ThrowIfNull(nameof(transport.Settings.Inferrer));
+
+ _transport = transport;
+
+ SetupNamespaces();
+ }
+
+ public IElasticsearchClientSettings ElasticsearchClientSettings => _transport.Settings;
+ public Inferrer Infer => _transport.Settings.Inferrer;
+ public Serializer RequestResponseSerializer => _transport.Settings.RequestResponseSerializer;
+ public Serializer SourceSerializer => _transport.Settings.SourceSerializer;
+ public HttpTransport Transport => _transport;
+
+ private ProductCheckStatus _productCheckStatus;
+
+ private enum ProductCheckStatus
+ {
+ NotChecked,
+ Succeeded,
+ Failed
+ }
+
+ private partial void SetupNamespaces();
+
+ internal TResponse DoRequest(TRequest request)
+ where TRequest : Request
+ where TResponse : ElasticsearchResponse, new()
+ where TRequestParameters : RequestParameters, new() =>
+ DoRequest(request, null);
+
+ internal TResponse DoRequest(
+ TRequest request,
+ Action? forceConfiguration)
+ where TRequest : Request
+ where TResponse : ElasticsearchResponse, new()
+ where TRequestParameters : RequestParameters, new()
+ => DoRequestCoreAsync(false, request, forceConfiguration).EnsureCompleted();
+
+ internal Task DoRequestAsync(
+ TRequest request,
+ CancellationToken cancellationToken = default)
+ where TRequest : Request
+ where TResponse : ElasticsearchResponse, new()
+ where TRequestParameters : RequestParameters, new()
+ => DoRequestAsync(request, null, cancellationToken);
+
+ internal Task DoRequestAsync(
+ TRequest request,
+ Action? forceConfiguration,
+ CancellationToken cancellationToken = default)
+ where TRequest : Request
+ where TResponse : ElasticsearchResponse, new()
+ where TRequestParameters : RequestParameters, new()
+ => DoRequestCoreAsync(true, request, forceConfiguration, cancellationToken).AsTask();
+
+ private ValueTask DoRequestCoreAsync(
+ bool isAsync,
+ TRequest request,
+ Action? forceConfiguration,
+ CancellationToken cancellationToken = default)
+ where TRequest : Request
+ where TResponse : ElasticsearchResponse, new()
+ where TRequestParameters : RequestParameters, new()
+ {
+ if (_productCheckStatus == ProductCheckStatus.Failed)
+ throw new UnsupportedProductException(UnsupportedProductException.InvalidProductError);
+
+ var (requestModified, hadRequestConfig, originalHeaders) = AttachProductCheckHeaderIfRequired(request);
+ var (resolvedUrl, urlTemplate, resolvedRouteValues, postData) = PrepareRequest(request, forceConfiguration);
+ var openTelemetryData = PrepareOpenTelemetryData(request, resolvedRouteValues);
+
+ if (_productCheckStatus == ProductCheckStatus.Succeeded && !requestModified)
+ {
+ if (isAsync)
+ return new ValueTask(_transport.RequestAsync(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData, cancellationToken));
+ else
+ return new ValueTask(_transport.Request(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData));
+ }
+
+ return SendRequest(isAsync);
+
+ async ValueTask SendRequest(bool isAsync)
+ {
+ TResponse response;
+
+ if (isAsync)
+ response = await _transport.RequestAsync(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData, cancellationToken).ConfigureAwait(false);
+ else
+ response = _transport.Request(request.HttpMethod, resolvedUrl, postData, request.RequestParameters, in openTelemetryData);
+
+ PostRequestProductCheck(request, response);
+
+ if (_productCheckStatus == ProductCheckStatus.Failed)
+ throw new UnsupportedProductException(UnsupportedProductException.InvalidProductError);
+
+ if (request.RequestParameters.RequestConfiguration is not null)
+ {
+ if (!hadRequestConfig)
+ {
+ request.RequestParameters.RequestConfiguration = null;
+ }
+ else if (originalHeaders.HasValue && originalHeaders.Value.Count > 0)
+ {
+ request.RequestParameters.RequestConfiguration.ResponseHeadersToParse = originalHeaders.Value;
+ }
+ }
+
+ return response;
+ }
+ }
+
+ private static OpenTelemetryData PrepareOpenTelemetryData(TRequest request, Dictionary resolvedRouteValues)
+ where TRequest : Request
+ where TRequestParameters : RequestParameters, new()
+ {
+ // If there are no subscribed listeners, we avoid some work and allocations
+ if (!Elastic.Transport.Diagnostics.OpenTelemetry.ElasticTransportActivitySourceHasListeners)
+ return default;
+
+ // We fall back to a general operation name in cases where the derived request fails to override the property
+ var operationName = !string.IsNullOrEmpty(request.OperationName) ? request.OperationName : request.HttpMethod.GetStringValue();
+
+ // TODO: Optimisation: We should consider caching these, either for cases where resolvedRouteValues is null, or
+ // caching per combination of route values.
+ // We should benchmark this first to assess the impact for common workloads.
+ // The former is likely going to save some short-lived allocations, but only for requests to endpoints without required path parts.
+ // The latter may bloat the cache as some combinations of path parts may rarely re-occur.
+ var attributes = new Dictionary
+ {
+ [OpenTelemetry.SemanticConventions.DbOperation] = !string.IsNullOrEmpty(request.OperationName) ? request.OperationName : "unknown",
+ [$"{OpenTelemetrySpanAttributePrefix}schema_url"] = OpenTelemetrySchemaVersion
+ };
+
+ if (resolvedRouteValues is not null)
+ {
+ foreach (var value in resolvedRouteValues)
+ {
+ if (!string.IsNullOrEmpty(value.Key) && !string.IsNullOrEmpty(value.Value))
+ attributes.Add($"{OpenTelemetrySpanAttributePrefix}path_parts.{value.Key}", value.Value);
+ }
+ }
+
+ var openTelemetryData = new OpenTelemetryData { SpanName = operationName, SpanAttributes = attributes };
+ return openTelemetryData;
+ }
+
+ private (bool requestModified, bool hadRequestConfig, HeadersList? originalHeaders) AttachProductCheckHeaderIfRequired(TRequest request)
+ where TRequest : Request
+ where TRequestParameters : RequestParameters, new()
+ {
+ var requestModified = false;
+ var hadRequestConfig = false;
+ HeadersList? originalHeaders = null;
+
+ // If we have not yet checked the product name, add the product header to the list of headers to parse.
+ if (_productCheckStatus == ProductCheckStatus.NotChecked)
+ {
+ requestModified = true;
+
+ if (request.RequestParameters.RequestConfiguration is null)
+ {
+ request.RequestParameters.RequestConfiguration = new RequestConfiguration();
+ }
+ else
+ {
+ originalHeaders = request.RequestParameters.RequestConfiguration.ResponseHeadersToParse;
+ hadRequestConfig = true;
+ }
+
+ if (request.RequestParameters.RequestConfiguration.ResponseHeadersToParse.Count == 0)
+ {
+ request.RequestParameters.RequestConfiguration.ResponseHeadersToParse = new HeadersList("x-elastic-product");
+ }
+ else
+ {
+ request.RequestParameters.RequestConfiguration.ResponseHeadersToParse = new HeadersList(request.RequestParameters.RequestConfiguration.ResponseHeadersToParse, "x-elastic-product");
+ }
+ }
+
+ return (requestModified, hadRequestConfig, originalHeaders);
+ }
+
+ private (string resolvedUrl, string urlTemplate, Dictionary? resolvedRouteValues, PostData data) PrepareRequest(TRequest request,
+ Action? forceConfiguration)
+ where TRequest : Request
+ where TRequestParameters : RequestParameters, new()
+ {
+ request.ThrowIfNull(nameof(request), "A request is required.");
+
+ if (forceConfiguration is not null)
+ ForceConfiguration(request, forceConfiguration);
+
+ if (request.ContentType is not null)
+ ForceContentType(request, request.ContentType);
+
+ if (request.Accept is not null)
+ ForceAccept(request, request.Accept);
+
+ var (resolvedUrl, urlTemplate, routeValues) = request.GetUrl(ElasticsearchClientSettings);
+
+ var postData =
+ request.HttpMethod == HttpMethod.GET ||
+ request.HttpMethod == HttpMethod.HEAD || !request.SupportsBody
+ ? null
+ : PostData.Serializable(request);
+
+ return (resolvedUrl, urlTemplate, routeValues, postData);
+ }
+
+ private void PostRequestProductCheck(TRequest request, TResponse response)
+ where TRequest : Request
+ where TResponse : ElasticsearchResponse, new()
+ {
+ if (response.ApiCallDetails.HttpStatusCode.HasValue && response.ApiCallDetails.HttpStatusCode.Value >= 200 && response.ApiCallDetails.HttpStatusCode.Value <= 299 && _productCheckStatus == ProductCheckStatus.NotChecked)
+ {
+ if (!response.ApiCallDetails.TryGetHeader("x-elastic-product", out var values) || !values.Single().Equals("Elasticsearch", StringComparison.Ordinal))
+ {
+ _productCheckStatus = ProductCheckStatus.Failed;
+ }
+
+ _productCheckStatus = ProductCheckStatus.Succeeded;
+ }
+ }
+
+ private static void ForceConfiguration(Request request, Action forceConfiguration)
+ where TRequestParameters : RequestParameters, new()
+ {
+ var configuration = request.RequestParameters.RequestConfiguration ?? new RequestConfiguration();
+ forceConfiguration(configuration);
+ request.RequestParameters.RequestConfiguration = configuration;
+ }
+
+ private static void ForceContentType(TRequest request, string contentType)
+ where TRequest : Request
+ where TRequestParameters : RequestParameters, new()
+ {
+ var configuration = request.RequestParameters.RequestConfiguration ?? new RequestConfiguration();
+ configuration.Accept = contentType;
+ configuration.ContentType = contentType;
+ request.RequestParameters.RequestConfiguration = configuration;
+ }
+
+ private static void ForceAccept(TRequest request, string acceptType)
+ where TRequest : Request
+ where TRequestParameters : RequestParameters, new()
+ {
+ var configuration = request.RequestParameters.RequestConfiguration ?? new RequestConfiguration();
+ configuration.Accept = acceptType;
+ request.RequestParameters.RequestConfiguration = configuration;
+ }
+
+ internal static void ForceJson(IRequestConfiguration requestConfiguration)
+ {
+ requestConfiguration.Accept = RequestData.DefaultMimeType;
+ requestConfiguration.ContentType = RequestData.DefaultMimeType;
+ }
+
+ internal static void ForceTextPlain(IRequestConfiguration requestConfiguration)
+ {
+ requestConfiguration.Accept = RequestData.MimeTypeTextPlain;
+ requestConfiguration.ContentType = RequestData.MimeTypeTextPlain;
+ }
+}
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Core/ElasticsearchClientProductRegistration.cs b/src/Elastic.Clients.Elasticsearch.Serverless/Core/ElasticsearchClientProductRegistration.cs
new file mode 100644
index 00000000000..a58f9af7ea9
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/Core/ElasticsearchClientProductRegistration.cs
@@ -0,0 +1,43 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using Elastic.Transport;
+using Elastic.Transport.Products.Elasticsearch;
+
+namespace Elastic.Clients.Elasticsearch.Serverless;
+
+internal sealed class ElasticsearchClientProductRegistration : ElasticsearchProductRegistration
+{
+ public ElasticsearchClientProductRegistration(Type markerType) : base(markerType) { }
+
+ public static ElasticsearchClientProductRegistration DefaultForElasticsearchClientsElasticsearch { get; } = new(typeof(ElasticsearchClient));
+
+ public override string ServiceIdentifier => "esv";
+
+ public override string DefaultMimeType => null; // Prevent base 'ElasticsearchProductRegistration' from sending the compatibility header
+
+ ///
+ /// Elastic.Clients.Elasticsearch handles 404 in its , we do not want the low level client throwing
+ /// exceptions
+ /// when is enabled for 404's. The client is in charge of
+ /// composing paths
+ /// so a 404 never signals a wrong URL but a missing entity.
+ ///
+ public override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) =>
+ statusCode is >= 200 and < 300 or 404;
+
+ ///
+ /// Makes the low level transport aware of Elastic.Clients.Elasticsearch's
+ /// so that it can peek in to its exposed error when reporting failures.
+ ///
+ public override bool TryGetServerErrorReason(TResponse response, [NotNullWhen(returnValue: true)] out string? reason)
+ {
+ if (response is not ElasticsearchResponse r)
+ return base.TryGetServerErrorReason(response, out reason);
+ reason = r.ElasticsearchServerError?.Error?.ToString();
+ return !string.IsNullOrEmpty(reason);
+ }
+}
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj
new file mode 100644
index 00000000000..9bc13018790
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/Elastic.Clients.Elasticsearch.Serverless.csproj
@@ -0,0 +1,44 @@
+
+
+ Elastic.Clients.Elasticsearch.Serverless
+ Elastic.Clients.Elasticsearch.Serverless - Official Elasticsearch Serverless .NET Client
+ elasticsearch;elastic;client;search
+
+ This strongly-typed, client library enables working with Elasticsearch Serverless. It is the official client maintained and supported by Elastic.
+
+ true
+ README.md
+
+
+ $(DefineConstants);ELASTICSEARCH_SERVERLESS
+
+
+ true
+ true
+ netstandard2.0;net461;netstandard2.1;netcoreapp3.1;net5.0;net6.0
+ true
+ true
+ annotations
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers
+
+
+
+
+
+
+
+
+
+ <_Parameter1>true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs
new file mode 100644
index 00000000000..d2b24366f4c
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/ApiUrlLookup.g.cs
@@ -0,0 +1,110 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+namespace Elastic.Clients.Elasticsearch.Serverless.Requests;
+
+internal static class ApiUrlLookup
+{
+ internal static ApiUrls AsyncSearchStatus = new ApiUrls(new[] { "_async_search/status/{id}" });
+ internal static ApiUrls AsyncSearchDelete = new ApiUrls(new[] { "_async_search/{id}" });
+ internal static ApiUrls AsyncSearchGet = new ApiUrls(new[] { "_async_search/{id}" });
+ internal static ApiUrls AsyncSearchSubmit = new ApiUrls(new[] { "_async_search", "{index}/_async_search" });
+ internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[] { "_bulk", "{index}/_bulk" });
+ internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[] { "_search/scroll" });
+ internal static ApiUrls NoNamespaceClosePointInTime = new ApiUrls(new[] { "_pit" });
+ internal static ApiUrls ClusterAllocationExplain = new ApiUrls(new[] { "_cluster/allocation/explain" });
+ internal static ApiUrls ClusterStats = new ApiUrls(new[] { "_cluster/stats", "_cluster/stats/nodes/{node_id}" });
+ internal static ApiUrls ClusterGetSettings = new ApiUrls(new[] { "_cluster/settings" });
+ internal static ApiUrls ClusterHealth = new ApiUrls(new[] { "_cluster/health", "_cluster/health/{index}" });
+ internal static ApiUrls ClusterPendingTasks = new ApiUrls(new[] { "_cluster/pending_tasks" });
+ internal static ApiUrls NoNamespaceCount = new ApiUrls(new[] { "_count", "{index}/_count" });
+ internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[] { "{index}/_create/{id}" });
+ internal static ApiUrls NoNamespaceDeleteByQuery = new ApiUrls(new[] { "{index}/_delete_by_query" });
+ internal static ApiUrls NoNamespaceDelete = new ApiUrls(new[] { "{index}/_doc/{id}" });
+ internal static ApiUrls NoNamespaceDeleteScript = new ApiUrls(new[] { "_scripts/{id}" });
+ internal static ApiUrls EnrichDeletePolicy = new ApiUrls(new[] { "_enrich/policy/{name}" });
+ internal static ApiUrls EnrichStats = new ApiUrls(new[] { "_enrich/_stats" });
+ internal static ApiUrls EnrichExecutePolicy = new ApiUrls(new[] { "_enrich/policy/{name}/_execute" });
+ internal static ApiUrls EnrichGetPolicy = new ApiUrls(new[] { "_enrich/policy/{name}", "_enrich/policy" });
+ internal static ApiUrls EnrichPutPolicy = new ApiUrls(new[] { "_enrich/policy/{name}" });
+ internal static ApiUrls NoNamespaceExists = new ApiUrls(new[] { "{index}/_doc/{id}" });
+ internal static ApiUrls NoNamespaceExistsSource = new ApiUrls(new[] { "{index}/_source/{id}" });
+ internal static ApiUrls NoNamespaceFieldCaps = new ApiUrls(new[] { "_field_caps", "{index}/_field_caps" });
+ internal static ApiUrls NoNamespaceGet = new ApiUrls(new[] { "{index}/_doc/{id}" });
+ internal static ApiUrls NoNamespaceGetScript = new ApiUrls(new[] { "_scripts/{id}" });
+ internal static ApiUrls NoNamespaceGetSource = new ApiUrls(new[] { "{index}/_source/{id}" });
+ internal static ApiUrls GraphExplore = new ApiUrls(new[] { "{index}/_graph/explore" });
+ internal static ApiUrls IndexManagementClose = new ApiUrls(new[] { "{index}/_close" });
+ internal static ApiUrls IndexManagementCreateDataStream = new ApiUrls(new[] { "_data_stream/{name}" });
+ internal static ApiUrls IndexManagementCreate = new ApiUrls(new[] { "{index}" });
+ internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "{index}/_alias/{name}" });
+ internal static ApiUrls IndexManagementDeleteDataLifecycle = new ApiUrls(new[] { "_data_stream/{name}/_lifecycle" });
+ internal static ApiUrls IndexManagementDeleteDataStream = new ApiUrls(new[] { "_data_stream/{name}" });
+ internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "{index}" });
+ internal static ApiUrls IndexManagementDeleteIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" });
+ internal static ApiUrls IndexManagementDeleteTemplate = new ApiUrls(new[] { "_template/{name}" });
+ internal static ApiUrls IndexManagementExistsAlias = new ApiUrls(new[] { "_alias/{name}", "{index}/_alias/{name}" });
+ internal static ApiUrls IndexManagementExistsIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" });
+ internal static ApiUrls IndexManagementExists = new ApiUrls(new[] { "{index}" });
+ internal static ApiUrls IndexManagementExistsTemplate = new ApiUrls(new[] { "_template/{name}" });
+ internal static ApiUrls IndexManagementExplainDataLifecycle = new ApiUrls(new[] { "{index}/_lifecycle/explain" });
+ internal static ApiUrls IndexManagementGetAlias = new ApiUrls(new[] { "_alias", "_alias/{name}", "{index}/_alias/{name}", "{index}/_alias" });
+ internal static ApiUrls IndexManagementGetDataLifecycle = new ApiUrls(new[] { "_data_stream/{name}/_lifecycle" });
+ internal static ApiUrls IndexManagementGetDataStream = new ApiUrls(new[] { "_data_stream", "_data_stream/{name}" });
+ internal static ApiUrls IndexManagementGet = new ApiUrls(new[] { "{index}" });
+ internal static ApiUrls IndexManagementGetIndexTemplate = new ApiUrls(new[] { "_index_template", "_index_template/{name}" });
+ internal static ApiUrls IndexManagementGetMapping = new ApiUrls(new[] { "_mapping", "{index}/_mapping" });
+ internal static ApiUrls IndexManagementGetTemplate = new ApiUrls(new[] { "_template", "_template/{name}" });
+ internal static ApiUrls IndexManagementStats = new ApiUrls(new[] { "_stats", "_stats/{metric}", "{index}/_stats", "{index}/_stats/{metric}" });
+ internal static ApiUrls IndexManagementMigrateToDataStream = new ApiUrls(new[] { "_data_stream/_migrate/{name}" });
+ internal static ApiUrls IndexManagementOpen = new ApiUrls(new[] { "{index}/_open" });
+ internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "{index}/_alias/{name}" });
+ internal static ApiUrls IndexManagementPutDataLifecycle = new ApiUrls(new[] { "_data_stream/{name}/_lifecycle" });
+ internal static ApiUrls IndexManagementPutIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" });
+ internal static ApiUrls IndexManagementPutMapping = new ApiUrls(new[] { "{index}/_mapping" });
+ internal static ApiUrls IndexManagementPutTemplate = new ApiUrls(new[] { "_template/{name}" });
+ internal static ApiUrls IndexManagementRollover = new ApiUrls(new[] { "{alias}/_rollover", "{alias}/_rollover/{new_index}" });
+ internal static ApiUrls IndexManagementSimulateIndexTemplate = new ApiUrls(new[] { "_index_template/_simulate_index/{name}" });
+ internal static ApiUrls IndexManagementSimulateTemplate = new ApiUrls(new[] { "_index_template/_simulate", "_index_template/_simulate/{name}" });
+ internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "_aliases" });
+ internal static ApiUrls NoNamespaceIndex = new ApiUrls(new[] { "{index}/_doc/{id}", "{index}/_doc" });
+ internal static ApiUrls NoNamespaceInfo = new ApiUrls(new[] { "" });
+ internal static ApiUrls IngestDeletePipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" });
+ internal static ApiUrls IngestGeoIpStats = new ApiUrls(new[] { "_ingest/geoip/stats" });
+ internal static ApiUrls IngestGetPipeline = new ApiUrls(new[] { "_ingest/pipeline", "_ingest/pipeline/{id}" });
+ internal static ApiUrls IngestProcessorGrok = new ApiUrls(new[] { "_ingest/processor/grok" });
+ internal static ApiUrls IngestPutPipeline = new ApiUrls(new[] { "_ingest/pipeline/{id}" });
+ internal static ApiUrls IngestSimulate = new ApiUrls(new[] { "_ingest/pipeline/_simulate", "_ingest/pipeline/{id}/_simulate" });
+ internal static ApiUrls NoNamespaceMget = new ApiUrls(new[] { "_mget", "{index}/_mget" });
+ internal static ApiUrls NoNamespaceMsearch = new ApiUrls(new[] { "_msearch", "{index}/_msearch" });
+ internal static ApiUrls NoNamespaceMsearchTemplate = new ApiUrls(new[] { "_msearch/template", "{index}/_msearch/template" });
+ internal static ApiUrls NoNamespaceMtermvectors = new ApiUrls(new[] { "_mtermvectors", "{index}/_mtermvectors" });
+ internal static ApiUrls NoNamespaceOpenPointInTime = new ApiUrls(new[] { "{index}/_pit" });
+ internal static ApiUrls NoNamespacePing = new ApiUrls(new[] { "" });
+ internal static ApiUrls NoNamespacePutScript = new ApiUrls(new[] { "_scripts/{id}", "_scripts/{id}/{context}" });
+ internal static ApiUrls NoNamespaceRankEval = new ApiUrls(new[] { "_rank_eval", "{index}/_rank_eval" });
+ internal static ApiUrls NoNamespaceRenderSearchTemplate = new ApiUrls(new[] { "_render/template", "_render/template/{id}" });
+ internal static ApiUrls NoNamespaceScroll = new ApiUrls(new[] { "_search/scroll" });
+ internal static ApiUrls NoNamespaceSearch = new ApiUrls(new[] { "_search", "{index}/_search" });
+ internal static ApiUrls NoNamespaceSearchTemplate = new ApiUrls(new[] { "_search/template", "{index}/_search/template" });
+ internal static ApiUrls NoNamespaceTermsEnum = new ApiUrls(new[] { "{index}/_terms_enum" });
+ internal static ApiUrls NoNamespaceTermvectors = new ApiUrls(new[] { "{index}/_termvectors/{id}", "{index}/_termvectors" });
+ internal static ApiUrls NoNamespaceUpdateByQuery = new ApiUrls(new[] { "{index}/_update_by_query" });
+ internal static ApiUrls NoNamespaceUpdate = new ApiUrls(new[] { "{index}/_update/{id}" });
+}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs
new file mode 100644
index 00000000000..62ed5b8b1a4
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs
@@ -0,0 +1,120 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Requests;
+using Elastic.Clients.Elasticsearch.Serverless.Serialization;
+using Elastic.Transport;
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+
+public sealed class AsyncSearchStatusRequestParameters : RequestParameters
+{
+}
+
+///
+/// Retreives the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
+///
+public sealed partial class AsyncSearchStatusRequest : PlainRequest
+{
+ public AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.status";
+}
+
+///
+/// Retreives the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
+///
+public sealed partial class AsyncSearchStatusRequestDescriptor : RequestDescriptor, AsyncSearchStatusRequestParameters>
+{
+ internal AsyncSearchStatusRequestDescriptor(Action> configure) => configure.Invoke(this);
+
+ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal AsyncSearchStatusRequestDescriptor()
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.status";
+
+ public AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id)
+ {
+ RouteValues.Required("id", id);
+ return Self;
+ }
+
+ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ {
+ }
+}
+
+///
+/// Retreives the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, use of this API is restricted to the `monitoring_user` role.
+///
+public sealed partial class AsyncSearchStatusRequestDescriptor : RequestDescriptor
+{
+ internal AsyncSearchStatusRequestDescriptor(Action configure) => configure.Invoke(this);
+
+ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal AsyncSearchStatusRequestDescriptor()
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.status";
+
+ public AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id)
+ {
+ RouteValues.Required("id", id);
+ return Self;
+ }
+
+ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
new file mode 100644
index 00000000000..86d5ee90665
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
@@ -0,0 +1,66 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Serialization;
+using Elastic.Transport.Products.Elasticsearch;
+using System;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+
+public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
+{
+ ///
+ /// Metadata about clusters involved in the cross-cluster search.
Not shown for local-only searches.
+ ///
+ [JsonInclude, JsonPropertyName("_clusters")]
+ public Elastic.Clients.Elasticsearch.Serverless.ClusterStatistics? Clusters { get; init; }
+
+ ///
+ /// If the async search completed, this field shows the status code of the search.
For example, 200 indicates that the async search was successfully completed.
503 indicates that the async search was completed with an error.
+ ///
+ [JsonInclude, JsonPropertyName("completion_status")]
+ public int? CompletionStatus { get; init; }
+ [JsonInclude, JsonPropertyName("completion_time")]
+ public DateTimeOffset? CompletionTime { get; init; }
+ [JsonInclude, JsonPropertyName("completion_time_in_millis")]
+ public long? CompletionTimeInMillis { get; init; }
+ [JsonInclude, JsonPropertyName("expiration_time")]
+ public DateTimeOffset? ExpirationTime { get; init; }
+ [JsonInclude, JsonPropertyName("expiration_time_in_millis")]
+ public long ExpirationTimeInMillis { get; init; }
+ [JsonInclude, JsonPropertyName("id")]
+ public string? Id { get; init; }
+ [JsonInclude, JsonPropertyName("is_partial")]
+ public bool IsPartial { get; init; }
+ [JsonInclude, JsonPropertyName("is_running")]
+ public bool IsRunning { get; init; }
+
+ ///
+ /// Indicates how many shards have run the query so far.
+ ///
+ [JsonInclude, JsonPropertyName("_shards")]
+ public Elastic.Clients.Elasticsearch.Serverless.ShardStatistics Shards { get; init; }
+ [JsonInclude, JsonPropertyName("start_time")]
+ public DateTimeOffset? StartTime { get; init; }
+ [JsonInclude, JsonPropertyName("start_time_in_millis")]
+ public long StartTimeInMillis { get; init; }
+}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs
new file mode 100644
index 00000000000..2ee9fd642df
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs
@@ -0,0 +1,120 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Requests;
+using Elastic.Clients.Elasticsearch.Serverless.Serialization;
+using Elastic.Transport;
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+
+public sealed class DeleteAsyncSearchRequestParameters : RequestParameters
+{
+}
+
+///
+/// Deletes an async search by identifier.
If the search is still running, the search request will be cancelled.
Otherwise, the saved search results are deleted.
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
+///
+public sealed partial class DeleteAsyncSearchRequest : PlainRequest
+{
+ public DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.delete";
+}
+
+///
+/// Deletes an async search by identifier.
If the search is still running, the search request will be cancelled.
Otherwise, the saved search results are deleted.
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
+///
+public sealed partial class DeleteAsyncSearchRequestDescriptor : RequestDescriptor, DeleteAsyncSearchRequestParameters>
+{
+ internal DeleteAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this);
+
+ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal DeleteAsyncSearchRequestDescriptor()
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.delete";
+
+ public DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id)
+ {
+ RouteValues.Required("id", id);
+ return Self;
+ }
+
+ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ {
+ }
+}
+
+///
+/// Deletes an async search by identifier.
If the search is still running, the search request will be cancelled.
Otherwise, the saved search results are deleted.
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.
+///
+public sealed partial class DeleteAsyncSearchRequestDescriptor : RequestDescriptor
+{
+ internal DeleteAsyncSearchRequestDescriptor(Action configure) => configure.Invoke(this);
+
+ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal DeleteAsyncSearchRequestDescriptor()
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.delete";
+
+ public DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id)
+ {
+ RouteValues.Required("id", id);
+ return Self;
+ }
+
+ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
new file mode 100644
index 00000000000..a56a97deed4
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
@@ -0,0 +1,35 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Serialization;
+using Elastic.Transport.Products.Elasticsearch;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+
+public sealed partial class DeleteAsyncSearchResponse : ElasticsearchResponse
+{
+ ///
+ /// For a successful response, this value is always true. On failure, an exception is returned instead.
+ ///
+ [JsonInclude, JsonPropertyName("acknowledged")]
+ public bool Acknowledged { get; init; }
+}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs
new file mode 100644
index 00000000000..04e0a14ab3e
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs
@@ -0,0 +1,160 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Requests;
+using Elastic.Clients.Elasticsearch.Serverless.Serialization;
+using Elastic.Transport;
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+
+public sealed class GetAsyncSearchRequestParameters : RequestParameters
+{
+ ///
+ /// Specifies how long the async search should be available in the cluster.
When not specified, the `keep_alive` set with the corresponding submit async request will be used.
Otherwise, it is possible to override the value and extend the validity of the request.
When this period expires, the search, if still running, is cancelled.
If the search is completed, its saved results are deleted.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
+
+ ///
+ /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ ///
+ public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); }
+
+ ///
+ /// Specifies to wait for the search to be completed up until the provided timeout.
Final results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires.
By default no timeout is set meaning that the currently available results will be returned without any additional wait.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
+}
+
+///
+/// Retrieves the results of a previously submitted async search request given its identifier.
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
+///
+public sealed partial class GetAsyncSearchRequest : PlainRequest
+{
+ public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.get";
+
+ ///
+ /// Specifies how long the async search should be available in the cluster.
When not specified, the `keep_alive` set with the corresponding submit async request will be used.
Otherwise, it is possible to override the value and extend the validity of the request.
When this period expires, the search, if still running, is cancelled.
If the search is completed, its saved results are deleted.
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
+
+ ///
+ /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ ///
+ [JsonIgnore]
+ public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); }
+
+ ///
+ /// Specifies to wait for the search to be completed up until the provided timeout.
Final results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires.
By default no timeout is set meaning that the currently available results will be returned without any additional wait.
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
+}
+
+///
+/// Retrieves the results of a previously submitted async search request given its identifier.
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
+///
+public sealed partial class GetAsyncSearchRequestDescriptor : RequestDescriptor, GetAsyncSearchRequestParameters>
+{
+ internal GetAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this);
+
+ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal GetAsyncSearchRequestDescriptor()
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.get";
+
+ public GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) => Qs("keep_alive", keepAlive);
+ public GetAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
+ public GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);
+
+ public GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id)
+ {
+ RouteValues.Required("id", id);
+ return Self;
+ }
+
+ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ {
+ }
+}
+
+///
+/// Retrieves the results of a previously submitted async search request given its identifier.
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.
+///
+public sealed partial class GetAsyncSearchRequestDescriptor : RequestDescriptor
+{
+ internal GetAsyncSearchRequestDescriptor(Action configure) => configure.Invoke(this);
+
+ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id id) : base(r => r.Required("id", id))
+ {
+ }
+
+ internal GetAsyncSearchRequestDescriptor()
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+
+ internal override bool SupportsBody => false;
+
+ internal override string OperationName => "async_search.get";
+
+ public GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) => Qs("keep_alive", keepAlive);
+ public GetAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
+ public GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);
+
+ public GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Serverless.Id id)
+ {
+ RouteValues.Required("id", id);
+ return Self;
+ }
+
+ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
new file mode 100644
index 00000000000..69f21655b0f
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
@@ -0,0 +1,51 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Serialization;
+using Elastic.Transport.Products.Elasticsearch;
+using System;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+
+public sealed partial class GetAsyncSearchResponse : ElasticsearchResponse
+{
+ [JsonInclude, JsonPropertyName("completion_time")]
+ public DateTimeOffset? CompletionTime { get; init; }
+ [JsonInclude, JsonPropertyName("completion_time_in_millis")]
+ public long? CompletionTimeInMillis { get; init; }
+ [JsonInclude, JsonPropertyName("expiration_time")]
+ public DateTimeOffset? ExpirationTime { get; init; }
+ [JsonInclude, JsonPropertyName("expiration_time_in_millis")]
+ public long ExpirationTimeInMillis { get; init; }
+ [JsonInclude, JsonPropertyName("id")]
+ public string? Id { get; init; }
+ [JsonInclude, JsonPropertyName("is_partial")]
+ public bool IsPartial { get; init; }
+ [JsonInclude, JsonPropertyName("is_running")]
+ public bool IsRunning { get; init; }
+ [JsonInclude, JsonPropertyName("response")]
+ public Elastic.Clients.Elasticsearch.Serverless.AsyncSearch.AsyncSearch Response { get; init; }
+ [JsonInclude, JsonPropertyName("start_time")]
+ public DateTimeOffset? StartTime { get; init; }
+ [JsonInclude, JsonPropertyName("start_time_in_millis")]
+ public long StartTimeInMillis { get; init; }
+}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
new file mode 100644
index 00000000000..d5d7c2b123a
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
@@ -0,0 +1,3088 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+//
+// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
+// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
+// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
+// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
+// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
+// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
+// ------------------------------------------------
+//
+// This file is automatically generated.
+// Please do not edit these files manually.
+//
+// ------------------------------------------------
+
+#nullable restore
+
+using Elastic.Clients.Elasticsearch.Serverless.Fluent;
+using Elastic.Clients.Elasticsearch.Serverless.Requests;
+using Elastic.Clients.Elasticsearch.Serverless.Serialization;
+using Elastic.Transport;
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Serverless.AsyncSearch;
+
+public sealed class SubmitAsyncSearchRequestParameters : RequestParameters
+{
+ ///
+ /// Blocks and waits until the search is completed up to a certain timeout.
When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
+
+ ///
+ /// If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.
+ ///
+ public bool? KeepOnCompletion { get => Q("keep_on_completion"); set => Q("keep_on_completion", value); }
+
+ ///
+ /// Specifies how long the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this period.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
+
+ ///
+ /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+ ///
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); }
+
+ ///
+ /// Indicate if an error should be returned if there is a partial search failure or timeout
+ ///
+ public bool? AllowPartialSearchResults { get => Q("allow_partial_search_results"); set => Q("allow_partial_search_results", value); }
+
+ ///
+ /// The analyzer to use for the query string
+ ///
+ public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); }
+
+ ///
+ /// Specify whether wildcard and prefix queries should be analyzed (default: false)
+ ///
+ public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); }
+
+ ///
+ /// Affects how often partial results become available, which happens whenever shard results are reduced.
A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).
+ ///
+ public long? BatchedReduceSize { get => Q("batched_reduce_size"); set => Q("batched_reduce_size", value); }
+
+ ///
+ /// The default value is the only supported value.
+ ///
+ public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
+
+ ///
+ /// The default operator for query string query (AND or OR)
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); }
+
+ ///
+ /// The field to use as default where no field prefix is given in the query string
+ ///
+ public string? Df { get => Q("df"); set => Q("df", value); }
+
+ ///
+ /// Whether to expand wildcard expression to concrete indices that are open, closed or both.
+ ///
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); }
+
+ ///
+ /// Whether specified concrete, expanded or aliased indices should be ignored when throttled
+ ///
+ public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); }
+
+ ///
+ /// Whether specified concrete indices should be ignored when unavailable (missing or closed)
+ ///
+ public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); }
+
+ ///
+ /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+ ///
+ public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); }
+
+ ///
+ /// The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
+ ///
+ public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); }
+ public string? MinCompatibleShardNode { get => Q("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); }
+
+ ///
+ /// Specify the node or shard the operation should be performed on (default: random)
+ ///
+ public string? Preference { get => Q("preference"); set => Q("preference", value); }
+
+ ///
+ /// The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped.
+ ///
+ public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); }
+
+ ///
+ /// Specify if request cache should be used for this request or not, defaults to true
+ ///
+ public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); }
+
+ ///
+ /// A comma-separated list of specific routing values
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); }
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); }
+
+ ///
+ /// Search operation type
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); }
+
+ ///
+ /// Specifies which field to use for suggestions.
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); }
+
+ ///
+ /// Specify suggest mode
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); }
+
+ ///
+ /// How many suggestions to return in response
+ ///
+ public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); }
+
+ ///
+ /// The source text for which the suggestions should be returned.
+ ///
+ public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); }
+
+ ///
+ /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ ///
+ public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); }
+ public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
+
+ ///
+ /// A list of fields to exclude from the returned _source field
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); }
+
+ ///
+ /// A list of fields to extract and return from the _source field
+ ///
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); }
+
+ ///
+ /// Query in the Lucene query string syntax
+ ///
+ public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); }
+}
+
+internal sealed partial class SubmitAsyncSearchRequestConverter : JsonConverter
+{
+ public override SubmitAsyncSearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ if (reader.TokenType != JsonTokenType.StartObject)
+ throw new JsonException("Unexpected JSON detected.");
+ var variant = new SubmitAsyncSearchRequest();
+ while (reader.Read() && reader.TokenType != JsonTokenType.EndObject)
+ {
+ if (reader.TokenType == JsonTokenType.PropertyName)
+ {
+ var property = reader.GetString();
+ if (property == "aggregations" || property == "aggs")
+ {
+ variant.Aggregations = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "collapse")
+ {
+ variant.Collapse = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "explain")
+ {
+ variant.Explain = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "ext")
+ {
+ variant.Ext = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "from")
+ {
+ variant.From = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "highlight")
+ {
+ variant.Highlight = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "track_total_hits")
+ {
+ variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "indices_boost")
+ {
+ variant.IndicesBoost = JsonSerializer.Deserialize>?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "docvalue_fields")
+ {
+ variant.DocvalueFields = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "knn")
+ {
+ variant.Knn = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "min_score")
+ {
+ variant.MinScore = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "post_filter")
+ {
+ variant.PostFilter = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "profile")
+ {
+ variant.Profile = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "query")
+ {
+ variant.Query = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "rescore")
+ {
+ variant.Rescore = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "script_fields")
+ {
+ variant.ScriptFields = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "search_after")
+ {
+ variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "size")
+ {
+ variant.Size = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "slice")
+ {
+ variant.Slice = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "sort")
+ {
+ variant.Sort = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "_source")
+ {
+ variant.Source = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "fields")
+ {
+ variant.Fields = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "suggest")
+ {
+ variant.Suggest = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "terminate_after")
+ {
+ variant.TerminateAfter = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "timeout")
+ {
+ variant.Timeout = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "track_scores")
+ {
+ variant.TrackScores = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "version")
+ {
+ variant.Version = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "seq_no_primary_term")
+ {
+ variant.SeqNoPrimaryTerm = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "stored_fields")
+ {
+ variant.StoredFields = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "pit")
+ {
+ variant.Pit = JsonSerializer.Deserialize(ref reader, options);
+ continue;
+ }
+
+ if (property == "runtime_mappings")
+ {
+ variant.RuntimeMappings = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+
+ if (property == "stats")
+ {
+ variant.Stats = JsonSerializer.Deserialize?>(ref reader, options);
+ continue;
+ }
+ }
+ }
+
+ return variant;
+ }
+
+ public override void Write(Utf8JsonWriter writer, SubmitAsyncSearchRequest value, JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ if (value.Aggregations is not null)
+ {
+ writer.WritePropertyName("aggregations");
+ JsonSerializer.Serialize(writer, value.Aggregations, options);
+ }
+
+ if (value.Collapse is not null)
+ {
+ writer.WritePropertyName("collapse");
+ JsonSerializer.Serialize(writer, value.Collapse, options);
+ }
+
+ if (value.Explain.HasValue)
+ {
+ writer.WritePropertyName("explain");
+ writer.WriteBooleanValue(value.Explain.Value);
+ }
+
+ if (value.Ext is not null)
+ {
+ writer.WritePropertyName("ext");
+ JsonSerializer.Serialize(writer, value.Ext, options);
+ }
+
+ if (value.From.HasValue)
+ {
+ writer.WritePropertyName("from");
+ writer.WriteNumberValue(value.From.Value);
+ }
+
+ if (value.Highlight is not null)
+ {
+ writer.WritePropertyName("highlight");
+ JsonSerializer.Serialize(writer, value.Highlight, options);
+ }
+
+ if (value.TrackTotalHits is not null)
+ {
+ writer.WritePropertyName("track_total_hits");
+ JsonSerializer.Serialize(writer, value.TrackTotalHits, options);
+ }
+
+ if (value.IndicesBoost is not null)
+ {
+ writer.WritePropertyName("indices_boost");
+ JsonSerializer.Serialize(writer, value.IndicesBoost, options);
+ }
+
+ if (value.DocvalueFields is not null)
+ {
+ writer.WritePropertyName("docvalue_fields");
+ JsonSerializer.Serialize(writer, value.DocvalueFields, options);
+ }
+
+ if (value.Knn is not null)
+ {
+ writer.WritePropertyName("knn");
+ JsonSerializer.Serialize(writer, value.Knn, options);
+ }
+
+ if (value.MinScore.HasValue)
+ {
+ writer.WritePropertyName("min_score");
+ writer.WriteNumberValue(value.MinScore.Value);
+ }
+
+ if (value.PostFilter is not null)
+ {
+ writer.WritePropertyName("post_filter");
+ JsonSerializer.Serialize(writer, value.PostFilter, options);
+ }
+
+ if (value.Profile.HasValue)
+ {
+ writer.WritePropertyName("profile");
+ writer.WriteBooleanValue(value.Profile.Value);
+ }
+
+ if (value.Query is not null)
+ {
+ writer.WritePropertyName("query");
+ JsonSerializer.Serialize(writer, value.Query, options);
+ }
+
+ if (value.Rescore is not null)
+ {
+ writer.WritePropertyName("rescore");
+ JsonSerializer.Serialize(writer, value.Rescore, options);
+ }
+
+ if (value.ScriptFields is not null)
+ {
+ writer.WritePropertyName("script_fields");
+ JsonSerializer.Serialize(writer, value.ScriptFields, options);
+ }
+
+ if (value.SearchAfter is not null)
+ {
+ writer.WritePropertyName("search_after");
+ JsonSerializer.Serialize(writer, value.SearchAfter, options);
+ }
+
+ if (value.Size.HasValue)
+ {
+ writer.WritePropertyName("size");
+ writer.WriteNumberValue(value.Size.Value);
+ }
+
+ if (value.Slice is not null)
+ {
+ writer.WritePropertyName("slice");
+ JsonSerializer.Serialize(writer, value.Slice, options);
+ }
+
+ if (value.Sort is not null)
+ {
+ writer.WritePropertyName("sort");
+ JsonSerializer.Serialize(writer, value.Sort, options);
+ }
+
+ if (value.Source is not null)
+ {
+ writer.WritePropertyName("_source");
+ JsonSerializer.Serialize(writer, value.Source, options);
+ }
+
+ if (value.Fields is not null)
+ {
+ writer.WritePropertyName("fields");
+ JsonSerializer.Serialize(writer, value.Fields, options);
+ }
+
+ if (value.Suggest is not null)
+ {
+ writer.WritePropertyName("suggest");
+ JsonSerializer.Serialize(writer, value.Suggest, options);
+ }
+
+ if (value.TerminateAfter.HasValue)
+ {
+ writer.WritePropertyName("terminate_after");
+ writer.WriteNumberValue(value.TerminateAfter.Value);
+ }
+
+ if (!string.IsNullOrEmpty(value.Timeout))
+ {
+ writer.WritePropertyName("timeout");
+ writer.WriteStringValue(value.Timeout);
+ }
+
+ if (value.TrackScores.HasValue)
+ {
+ writer.WritePropertyName("track_scores");
+ writer.WriteBooleanValue(value.TrackScores.Value);
+ }
+
+ if (value.Version.HasValue)
+ {
+ writer.WritePropertyName("version");
+ writer.WriteBooleanValue(value.Version.Value);
+ }
+
+ if (value.SeqNoPrimaryTerm.HasValue)
+ {
+ writer.WritePropertyName("seq_no_primary_term");
+ writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value);
+ }
+
+ if (value.StoredFields is not null)
+ {
+ writer.WritePropertyName("stored_fields");
+ JsonSerializer.Serialize(writer, value.StoredFields, options);
+ }
+
+ if (value.Pit is not null)
+ {
+ writer.WritePropertyName("pit");
+ JsonSerializer.Serialize(writer, value.Pit, options);
+ }
+
+ if (value.RuntimeMappings is not null)
+ {
+ writer.WritePropertyName("runtime_mappings");
+ JsonSerializer.Serialize(writer, value.RuntimeMappings, options);
+ }
+
+ if (value.Stats is not null)
+ {
+ writer.WritePropertyName("stats");
+ JsonSerializer.Serialize(writer, value.Stats, options);
+ }
+
+ writer.WriteEndObject();
+ }
+}
+
+[JsonConverter(typeof(SubmitAsyncSearchRequestConverter))]
+///
+/// Runs a search request asynchronously.
When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested.
Warning: Async search does not support scroll nor search requests that only include the suggest section.
By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
+///
+public sealed partial class SubmitAsyncSearchRequest : PlainRequest
+{
+ public SubmitAsyncSearchRequest()
+ {
+ }
+
+ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices))
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchSubmit;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
+
+ internal override bool SupportsBody => true;
+
+ internal override string OperationName => "async_search.submit";
+
+ ///
+ /// Blocks and waits until the search is completed up to a certain timeout.
When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
+
+ ///
+ /// If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.
+ ///
+ [JsonIgnore]
+ public bool? KeepOnCompletion { get => Q("keep_on_completion"); set => Q("keep_on_completion", value); }
+
+ ///
+ /// Specifies how long the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this period.
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
+
+ ///
+ /// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
+ ///
+ [JsonIgnore]
+ public bool? AllowNoIndices { get => Q("allow_no_indices"); set => Q("allow_no_indices", value); }
+
+ ///
+ /// Indicate if an error should be returned if there is a partial search failure or timeout
+ ///
+ [JsonIgnore]
+ public bool? AllowPartialSearchResults { get => Q("allow_partial_search_results"); set => Q("allow_partial_search_results", value); }
+
+ ///
+ /// The analyzer to use for the query string
+ ///
+ [JsonIgnore]
+ public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); }
+
+ ///
+ /// Specify whether wildcard and prefix queries should be analyzed (default: false)
+ ///
+ [JsonIgnore]
+ public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); }
+
+ ///
+ /// Affects how often partial results become available, which happens whenever shard results are reduced.
A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).
+ ///
+ [JsonIgnore]
+ public long? BatchedReduceSize { get => Q("batched_reduce_size"); set => Q("batched_reduce_size", value); }
+
+ ///
+ /// The default value is the only supported value.
+ ///
+ [JsonIgnore]
+ public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
+
+ ///
+ /// The default operator for query string query (AND or OR)
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); }
+
+ ///
+ /// The field to use as default where no field prefix is given in the query string
+ ///
+ [JsonIgnore]
+ public string? Df { get => Q("df"); set => Q("df", value); }
+
+ ///
+ /// Whether to expand wildcard expression to concrete indices that are open, closed or both.
+ ///
+ [JsonIgnore]
+ public ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); }
+
+ ///
+ /// Whether specified concrete, expanded or aliased indices should be ignored when throttled
+ ///
+ [JsonIgnore]
+ public bool? IgnoreThrottled { get => Q("ignore_throttled"); set => Q("ignore_throttled", value); }
+
+ ///
+ /// Whether specified concrete indices should be ignored when unavailable (missing or closed)
+ ///
+ [JsonIgnore]
+ public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); }
+
+ ///
+ /// Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
+ ///
+ [JsonIgnore]
+ public bool? Lenient { get => Q("lenient"); set => Q("lenient", value); }
+
+ ///
+ /// The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
+ ///
+ [JsonIgnore]
+ public long? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); }
+ [JsonIgnore]
+ public string? MinCompatibleShardNode { get => Q("min_compatible_shard_node"); set => Q("min_compatible_shard_node", value); }
+
+ ///
+ /// Specify the node or shard the operation should be performed on (default: random)
+ ///
+ [JsonIgnore]
+ public string? Preference { get => Q("preference"); set => Q("preference", value); }
+
+ ///
+ /// The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped.
+ ///
+ [JsonIgnore]
+ public long? PreFilterShardSize { get => Q("pre_filter_shard_size"); set => Q("pre_filter_shard_size", value); }
+
+ ///
+ /// Specify if request cache should be used for this request or not, defaults to true
+ ///
+ [JsonIgnore]
+ public bool? RequestCache { get => Q("request_cache"); set => Q("request_cache", value); }
+
+ ///
+ /// A comma-separated list of specific routing values
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Routing? Routing { get => Q("routing"); set => Q("routing", value); }
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Duration? Scroll { get => Q("scroll"); set => Q("scroll", value); }
+
+ ///
+ /// Search operation type
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); }
+
+ ///
+ /// Specifies which field to use for suggestions.
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); }
+
+ ///
+ /// Specify suggest mode
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); }
+
+ ///
+ /// How many suggestions to return in response
+ ///
+ [JsonIgnore]
+ public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); }
+
+ ///
+ /// The source text for which the suggestions should be returned.
+ ///
+ [JsonIgnore]
+ public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); }
+
+ ///
+ /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ ///
+ [JsonIgnore]
+ public bool? TypedKeys { get => Q("typed_keys"); set => Q("typed_keys", value); }
+ [JsonIgnore]
+ public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
+
+ ///
+ /// A list of fields to exclude from the returned _source field
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); }
+
+ ///
+ /// A list of fields to extract and return from the _source field
+ ///
+ [JsonIgnore]
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); }
+
+ ///
+ /// Query in the Lucene query string syntax
+ ///
+ [JsonIgnore]
+ public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); }
+ [JsonInclude, JsonPropertyName("aggregations")]
+ public Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? Aggregations { get; set; }
+ [JsonInclude, JsonPropertyName("collapse")]
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? Collapse { get; set; }
+
+ ///
+ /// If true, returns detailed information about score computation as part of a hit.
+ ///
+ [JsonInclude, JsonPropertyName("explain")]
+ public bool? Explain { get; set; }
+
+ ///
+ /// Configuration of search extensions defined by Elasticsearch plugins.
+ ///
+ [JsonInclude, JsonPropertyName("ext")]
+ public IDictionary? Ext { get; set; }
+
+ ///
+ /// Starting document offset. By default, you cannot page through more than 10,000
hits using the from and size parameters. To page through more hits, use the
search_after parameter.
+ ///
+ [JsonInclude, JsonPropertyName("from")]
+ public int? From { get; set; }
+ [JsonInclude, JsonPropertyName("highlight")]
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? Highlight { get; set; }
+
+ ///
+ /// Number of hits matching the query to count accurately. If true, the exact
number of hits is returned at the cost of some performance. If false, the
response does not include the total number of hits matching the query.
Defaults to 10,000 hits.
+ ///
+ [JsonInclude, JsonPropertyName("track_total_hits")]
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.TrackHits? TrackTotalHits { get; set; }
+
+ ///
+ /// Boosts the _score of documents from specified indices.
+ ///
+ [JsonInclude, JsonPropertyName("indices_boost")]
+ public ICollection>? IndicesBoost { get; set; }
+
+ ///
+ /// Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("docvalue_fields")]
+ public ICollection? DocvalueFields { get; set; }
+
+ ///
+ /// Defines the approximate kNN search to run.
+ ///
+ [JsonInclude, JsonPropertyName("knn"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.KnnQuery))]
+ public ICollection? Knn { get; set; }
+
+ ///
+ /// Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
+ ///
+ [JsonInclude, JsonPropertyName("min_score")]
+ public double? MinScore { get; set; }
+ [JsonInclude, JsonPropertyName("post_filter")]
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilter { get; set; }
+ [JsonInclude, JsonPropertyName("profile")]
+ public bool? Profile { get; set; }
+
+ ///
+ /// Defines the search definition using the Query DSL.
+ ///
+ [JsonInclude, JsonPropertyName("query")]
+ public Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? Query { get; set; }
+ [JsonInclude, JsonPropertyName("rescore"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.Core.Search.Rescore))]
+ public ICollection? Rescore { get; set; }
+
+ ///
+ /// Retrieve a script evaluation (based on different fields) for each hit.
+ ///
+ [JsonInclude, JsonPropertyName("script_fields")]
+ public IDictionary? ScriptFields { get; set; }
+ [JsonInclude, JsonPropertyName("search_after")]
+ public ICollection? SearchAfter { get; set; }
+
+ ///
+ /// The number of hits to return. By default, you cannot page through more
than 10,000 hits using the from and size parameters. To page through more
hits, use the search_after parameter.
+ ///
+ [JsonInclude, JsonPropertyName("size")]
+ public int? Size { get; set; }
+ [JsonInclude, JsonPropertyName("slice")]
+ public Elastic.Clients.Elasticsearch.Serverless.SlicedScroll? Slice { get; set; }
+ [JsonInclude, JsonPropertyName("sort"), SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Serverless.SortOptions))]
+ public ICollection? Sort { get; set; }
+
+ ///
+ /// Indicates which source fields are returned for matching documents. These
fields are returned in the hits._source property of the search response.
+ ///
+ [JsonInclude, JsonPropertyName("_source")]
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.SourceConfig? Source { get; set; }
+
+ ///
+ /// Array of wildcard (*) patterns. The request returns values for field names
matching these patterns in the hits.fields property of the response.
+ ///
+ [JsonInclude, JsonPropertyName("fields")]
+ public ICollection? Fields { get; set; }
+ [JsonInclude, JsonPropertyName("suggest")]
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.Suggester? Suggest { get; set; }
+
+ ///
+ /// Maximum number of documents to collect for each shard. If a query reaches this
limit, Elasticsearch terminates the query early. Elasticsearch collects documents
before sorting. Defaults to 0, which does not terminate query execution early.
+ ///
+ [JsonInclude, JsonPropertyName("terminate_after")]
+ public long? TerminateAfter { get; set; }
+
+ ///
+ /// Specifies the period of time to wait for a response from each shard. If no response
is received before the timeout expires, the request fails and returns an error.
Defaults to no timeout.
+ ///
+ [JsonInclude, JsonPropertyName("timeout")]
+ public string? Timeout { get; set; }
+
+ ///
+ /// If true, calculate and return document scores, even if the scores are not used for sorting.
+ ///
+ [JsonInclude, JsonPropertyName("track_scores")]
+ public bool? TrackScores { get; set; }
+
+ ///
+ /// If true, returns document version as part of a hit.
+ ///
+ [JsonInclude, JsonPropertyName("version")]
+ public bool? Version { get; set; }
+
+ ///
+ /// If true, returns sequence number and primary term of the last modification
of each hit. See Optimistic concurrency control.
+ ///
+ [JsonInclude, JsonPropertyName("seq_no_primary_term")]
+ public bool? SeqNoPrimaryTerm { get; set; }
+
+ ///
+ /// List of stored fields to return as part of a hit. If no fields are specified,
no stored fields are included in the response. If this field is specified, the _source
parameter defaults to false. You can pass _source: true to return both source fields
and stored fields in the search response.
+ ///
+ [JsonInclude, JsonPropertyName("stored_fields")]
+ public Elastic.Clients.Elasticsearch.Serverless.Fields? StoredFields { get; set; }
+
+ ///
+ /// Limits the search to a point in time (PIT). If you provide a PIT, you
cannot specify an in the request path.
+ ///
+ [JsonInclude, JsonPropertyName("pit")]
+ public Elastic.Clients.Elasticsearch.Serverless.Core.Search.PointInTimeReference? Pit { get; set; }
+
+ ///
+ /// Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
+ ///
+ [JsonInclude, JsonPropertyName("runtime_mappings")]
+ public IDictionary? RuntimeMappings { get; set; }
+
+ ///
+ /// Stats groups to associate with the search. Each group maintains a statistics
aggregation for its associated searches. You can retrieve these stats using
the indices stats API.
+ ///
+ [JsonInclude, JsonPropertyName("stats")]
+ public ICollection? Stats { get; set; }
+}
+
+///
+/// Runs a search request asynchronously.
When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field, hence partial results become available following the sort criteria that was requested.
Warning: Async search does not support scroll nor search requests that only include the suggest section.
By default, Elasticsearch doesn’t allow you to store an async search response larger than 10Mb and an attempt to do this results in an error.
The maximum allowed size for a stored async search response can be set by changing the `search.max_async_search_response_size` cluster level setting.
+///
+public sealed partial class SubmitAsyncSearchRequestDescriptor : RequestDescriptor, SubmitAsyncSearchRequestParameters>
+{
+ internal SubmitAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this);
+
+ public SubmitAsyncSearchRequestDescriptor()
+ {
+ }
+
+ internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchSubmit;
+
+ protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
+
+ internal override bool SupportsBody => true;
+
+ internal override string OperationName => "async_search.submit";
+
+ public SubmitAsyncSearchRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes);
+ public SubmitAsyncSearchRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Serverless.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes);
+ public SubmitAsyncSearchRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices);
+ public SubmitAsyncSearchRequestDescriptor AllowPartialSearchResults(bool? allowPartialSearchResults = true) => Qs("allow_partial_search_results", allowPartialSearchResults);
+ public SubmitAsyncSearchRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard);
+ public SubmitAsyncSearchRequestDescriptor Analyzer(string? analyzer) => Qs("analyzer", analyzer);
+ public SubmitAsyncSearchRequestDescriptor BatchedReduceSize(long? batchedReduceSize) => Qs("batched_reduce_size", batchedReduceSize);
+ public SubmitAsyncSearchRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips);
+ public SubmitAsyncSearchRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Operator? defaultOperator) => Qs("default_operator", defaultOperator);
+ public SubmitAsyncSearchRequestDescriptor Df(string? df) => Qs("df", df);
+ public SubmitAsyncSearchRequestDescriptor ExpandWildcards(ICollection? expandWildcards) => Qs("expand_wildcards", expandWildcards);
+ public SubmitAsyncSearchRequestDescriptor IgnoreThrottled(bool? ignoreThrottled = true) => Qs("ignore_throttled", ignoreThrottled);
+ public SubmitAsyncSearchRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable);
+ public SubmitAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Serverless.Duration? keepAlive) => Qs("keep_alive", keepAlive);
+ public SubmitAsyncSearchRequestDescriptor KeepOnCompletion(bool? keepOnCompletion = true) => Qs("keep_on_completion", keepOnCompletion);
+ public SubmitAsyncSearchRequestDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient);
+ public SubmitAsyncSearchRequestDescriptor MaxConcurrentShardRequests(long? maxConcurrentShardRequests) => Qs("max_concurrent_shard_requests", maxConcurrentShardRequests);
+ public SubmitAsyncSearchRequestDescriptor MinCompatibleShardNode(string? minCompatibleShardNode) => Qs("min_compatible_shard_node", minCompatibleShardNode);
+ public SubmitAsyncSearchRequestDescriptor PreFilterShardSize(long? preFilterShardSize) => Qs("pre_filter_shard_size", preFilterShardSize);
+ public SubmitAsyncSearchRequestDescriptor Preference(string? preference) => Qs("preference", preference);
+ public SubmitAsyncSearchRequestDescriptor QueryLuceneSyntax(string? q) => Qs("q", q);
+ public SubmitAsyncSearchRequestDescriptor RequestCache(bool? requestCache = true) => Qs("request_cache", requestCache);
+ public SubmitAsyncSearchRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt);
+ public SubmitAsyncSearchRequestDescriptor Routing(Elastic.Clients.Elasticsearch.Serverless.Routing? routing) => Qs("routing", routing);
+ public SubmitAsyncSearchRequestDescriptor Scroll(Elastic.Clients.Elasticsearch.Serverless.Duration? scroll) => Qs("scroll", scroll);
+ public SubmitAsyncSearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType);
+ public SubmitAsyncSearchRequestDescriptor SuggestField(Elastic.Clients.Elasticsearch.Serverless.Field? suggestField) => Qs("suggest_field", suggestField);
+ public SubmitAsyncSearchRequestDescriptor SuggestMode(Elastic.Clients.Elasticsearch.Serverless.SuggestMode? suggestMode) => Qs("suggest_mode", suggestMode);
+ public SubmitAsyncSearchRequestDescriptor SuggestSize(long? suggestSize) => Qs("suggest_size", suggestSize);
+ public SubmitAsyncSearchRequestDescriptor SuggestText(string? suggestText) => Qs("suggest_text", suggestText);
+ public SubmitAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
+ public SubmitAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Serverless.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);
+
+ public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices)
+ {
+ RouteValues.Optional("index", indices);
+ return Self;
+ }
+
+ private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDictionary? AggregationsValue { get; set; }
+ private Elastic.Clients.Elasticsearch.Serverless.Aggregations.AggregationDescriptor AggregationsDescriptor { get; set; }
+ private Action> AggregationsDescriptorAction { get; set; }
+ private Elastic.Clients.Elasticsearch.Serverless.Core.Search.FieldCollapse? CollapseValue { get; set; }
+ private Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; }
+ private Action> CollapseDescriptorAction { get; set; }
+ private ICollection? DocvalueFieldsValue { get; set; }
+ private QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; }
+ private Action> DocvalueFieldsDescriptorAction { get; set; }
+ private Action>[] DocvalueFieldsDescriptorActions { get; set; }
+ private ICollection? FieldsValue { get; set; }
+ private QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; }
+ private Action> FieldsDescriptorAction { get; set; }
+ private Action>[] FieldsDescriptorActions { get; set; }
+ private Elastic.Clients.Elasticsearch.Serverless.Core.Search.Highlight? HighlightValue { get; set; }
+ private Core.Search.HighlightDescriptor HighlightDescriptor { get; set; }
+ private Action> HighlightDescriptorAction { get; set; }
+ private ICollection? KnnValue { get; set; }
+ private KnnQueryDescriptor KnnDescriptor { get; set; }
+ private Action> KnnDescriptorAction { get; set; }
+ private Action>[] KnnDescriptorActions { get; set; }
+ private Elastic.Clients.Elasticsearch.Serverless.QueryDsl.Query? PostFilterValue { get; set; }
+ private QueryDsl.QueryDescriptor