diff --git a/.buildkite/DockerFile b/.buildkite/DockerFile
index 227524274d2..9ccd51b4944 100644
--- a/.buildkite/DockerFile
+++ b/.buildkite/DockerFile
@@ -1,4 +1,4 @@
-ARG DOTNET_VERSION=8.0.400
+ARG DOTNET_VERSION=9.0.100
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build
ENV NUGET_SCRATCH="/tmp/NuGetScratch"
diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml
index 87f461176da..b702d1737b2 100644
--- a/.buildkite/pipeline.yml
+++ b/.buildkite/pipeline.yml
@@ -5,7 +5,7 @@ steps:
env:
TEST_SUITE: "{{ matrix.suite }}"
STACK_VERSION: master-SNAPSHOT
- DOTNET_VERSION: 8.0.400
+ DOTNET_VERSION: 9.0.100
matrix:
setup:
suite:
diff --git a/.buildkite/run-repository.ps1 b/.buildkite/run-repository.ps1
index 4a290f1c625..774f3684ccd 100644
--- a/.buildkite/run-repository.ps1
+++ b/.buildkite/run-repository.ps1
@@ -14,7 +14,7 @@ param(
$NODE_NAME,
[string]
- $DOTNET_VERSION = "8.0.400"
+ $DOTNET_VERSION = "9.0.100"
)
$ESC = [char]27
diff --git a/.buildkite/run-repository.sh b/.buildkite/run-repository.sh
index 9c212f484c1..d0b1ba84870 100755
--- a/.buildkite/run-repository.sh
+++ b/.buildkite/run-repository.sh
@@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
-DOTNET_VERSION=${DOTNET_VERSION-8.0.400}
+DOTNET_VERSION=${DOTNET_VERSION-9.0.100}
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
elasticsearch_container=${elasticsearch_container-}
diff --git a/.buildkite/run-tests.ps1 b/.buildkite/run-tests.ps1
index 503edd8df06..3113065ce2d 100644
--- a/.buildkite/run-tests.ps1
+++ b/.buildkite/run-tests.ps1
@@ -8,7 +8,7 @@ param (
$TEST_SUITE = "free",
[string]
- $DOTNET_VERSION = "8.0.400"
+ $DOTNET_VERSION = "9.0.100"
)
$ESC = [char]27
diff --git a/.ci/DockerFile b/.ci/DockerFile
index 8c642b99967..5ba098c2552 100644
--- a/.ci/DockerFile
+++ b/.ci/DockerFile
@@ -1,4 +1,4 @@
-ARG DOTNET_VERSION=8.0.400
+ARG DOTNET_VERSION=9.0.100
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build
ENV NUGET_SCRATCH="/tmp/NuGetScratch"
diff --git a/.ci/make.sh b/.ci/make.sh
index 672ad78bd7d..ad1dd59e455 100755
--- a/.ci/make.sh
+++ b/.ci/make.sh
@@ -42,7 +42,7 @@ OUTPUT_DIR="$repo/${output_folder}"
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
mkdir -p "$OUTPUT_DIR"
-DOTNET_VERSION=${DOTNET_VERSION-8.0.400}
+DOTNET_VERSION=${DOTNET_VERSION-9.0.100}
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
diff --git a/.ci/readme.md b/.ci/readme.md
index fe87c60afd4..95bd4f20fc9 100644
--- a/.ci/readme.md
+++ b/.ci/readme.md
@@ -30,7 +30,7 @@ $ STACK_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests
|-------------------------|-------------|-------------|
| `STACK_VERSION` | `N/A` | The elasticsearch version to target
| `TEST_SUITE` | `basic` | `free` or `platinum` sets which test suite to run and which container to run against. |
-| `DOTNET_VERSION` | `8.0.400` | The .NET sdk version used to grab the proper container |
+| `DOTNET_VERSION` | `9.0.100` | The .NET sdk version used to grab the proper container |
If you want to manually spin up elasticsearch for these tests and call the runner afterwards you can use
diff --git a/.ci/run-repository.ps1 b/.ci/run-repository.ps1
index e842f7fe215..877995e542f 100644
--- a/.ci/run-repository.ps1
+++ b/.ci/run-repository.ps1
@@ -14,7 +14,7 @@ param(
$NODE_NAME,
[string]
- $DOTNET_VERSION = "8.0.400"
+ $DOTNET_VERSION = "9.0.100"
)
$ESC = [char]27
diff --git a/.ci/run-repository.sh b/.ci/run-repository.sh
index 0e49cdaf1bf..2191e872ea9 100755
--- a/.ci/run-repository.sh
+++ b/.ci/run-repository.sh
@@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail
-DOTNET_VERSION=${DOTNET_VERSION-8.0.400}
+DOTNET_VERSION=${DOTNET_VERSION-9.0.100}
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
elasticsearch_container=${elasticsearch_container-}
diff --git a/.ci/run-tests.ps1 b/.ci/run-tests.ps1
index 481ad155dbd..89b91ebaadf 100644
--- a/.ci/run-tests.ps1
+++ b/.ci/run-tests.ps1
@@ -8,7 +8,7 @@ param (
$TEST_SUITE = "free",
[string]
- $DOTNET_VERSION = "8.0.400"
+ $DOTNET_VERSION = "9.0.100"
)
$ESC = [char]27
diff --git a/.ci/test-matrix.yml b/.ci/test-matrix.yml
index 421f57f8973..0c4a5a2b9ba 100755
--- a/.ci/test-matrix.yml
+++ b/.ci/test-matrix.yml
@@ -8,6 +8,6 @@ TEST_SUITE:
- platinum
DOTNET_VERSION:
- - 8.0.400
+ - 9.0.100
exclude: ~
diff --git a/Directory.Build.props b/Directory.Build.props
index 91ddb2e93ec..cdc634db8d7 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -50,4 +50,8 @@
+
+
+ NU1901;NU1902;NU1903;NU1904
+
\ No newline at end of file
diff --git a/Elasticsearch.sln b/Elasticsearch.sln
index 4bf57fbcf3a..242fd14cf6b 100644
--- a/Elasticsearch.sln
+++ b/Elasticsearch.sln
@@ -55,8 +55,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "scripts", "build\scripts\sc
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.ClusterLauncher", "tests\Tests.ClusterLauncher\Tests.ClusterLauncher.csproj", "{F6162603-D134-4121-8106-2BA4DAD7350B}"
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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "tests\Tests\Tests.csproj", "{6FD804B2-CE80-41CB-A411-2023F34C18FE}"
EndProject
Global
@@ -101,10 +99,6 @@ Global
{F6162603-D134-4121-8106-2BA4DAD7350B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6162603-D134-4121-8106-2BA4DAD7350B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6162603-D134-4121-8106-2BA4DAD7350B}.Release|Any CPU.Build.0 = Release|Any CPU
- {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8C9275D9-29CE-4A20-8FD5-6B26C6CAAADB}.Release|Any CPU.Build.0 = Release|Any CPU
{6FD804B2-CE80-41CB-A411-2023F34C18FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6FD804B2-CE80-41CB-A411-2023F34C18FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FD804B2-CE80-41CB-A411-2023F34C18FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -123,7 +117,6 @@ Global
{F8A7E60C-0C48-4D76-AF7F-7881DF5A263D} = {D455EC79-E1E0-4509-B297-0DA3AED8DFF7}
{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}
{6FD804B2-CE80-41CB-A411-2023F34C18FE} = {362B2776-4B29-46AB-B237-56776B5372B6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
diff --git a/build/scripts/Versioning.fs b/build/scripts/Versioning.fs
index 4b27be22871..a3b9d7f2c07 100644
--- a/build/scripts/Versioning.fs
+++ b/build/scripts/Versioning.fs
@@ -17,7 +17,7 @@ module Versioning =
// Since that file is now generated by the dotnet tooling and GitVersion and similar tooling all still have
// active issues related to dotnet core, we now just burn this info in global.json
- let parse (v:string) = SemVer.parse(v)
+ let parse (v: string) = SemVer.parse(if String.IsNullOrEmpty(v) then "1.0.0" else v)
//Versions in form of e.g 6.1.0 is inferred as datetime so we bake the json shape into the provider like this
type SdkVersion = { version:string; rollForward:string; allowPrerelease:bool }
diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj
index 29ab285f8f5..94f4e3194ff 100644
--- a/build/scripts/scripts.fsproj
+++ b/build/scripts/scripts.fsproj
@@ -1,6 +1,6 @@
- net8.0
+ net9.0
Exe
$(NoWarn);NU1701
diff --git a/docs/release-notes/breaking-changes.md b/docs/release-notes/breaking-changes.md
index d228e13f0b9..e6f8d4c8c5a 100644
--- a/docs/release-notes/breaking-changes.md
+++ b/docs/release-notes/breaking-changes.md
@@ -5,22 +5,208 @@ mapped_pages:
---
# Elasticsearch .NET Client breaking changes [elasticsearch-net-client-breaking-changes]
+
Breaking changes can impact your Elastic applications, potentially disrupting normal operations. Before you upgrade, carefully review the Elasticsearch .NET Client breaking changes and take the necessary steps to mitigate any issues. To learn how to upgrade, check [Upgrade](docs-content://deploy-manage/upgrade.md).
-% ## Next version [elasticsearch-nett-client-nextversion-breaking-changes]
+% ## Next version [elasticsearch-net-client-nextversion-breaking-changes]
% ::::{dropdown} Title of breaking change
+%
+% **Impact**: High/Low.
+%
% Description of the breaking change.
% For more information, check [PR #](PR link).
-% **Impact**
Impact of the breaking change.
-% **Action**
Steps for mitigating deprecation impact.
+%
% ::::
-% ## 9.0.0 [elasticsearch-nett-client-900-breaking-changes]
+## 9.0.0 [elasticsearch-net-client-900-breaking-changes]
-% ::::{dropdown} Title of breaking change
-% Description of the breaking change.
-% For more information, check [PR #](PR link).
-% **Impact**
Impact of the breaking change.
-% **Action**
Steps for mitigating deprecation impact.
-% ::::
\ No newline at end of file
+### Overview
+
+- [1. Container types](#1-container-types)
+- [2. Removal of certain generic request descriptors](#2-removal-of-certain-generic-request-descriptors)
+- [3. Removal of certain descriptor constructors and related request APIs](#3-removal-of-certain-descriptor-constructors-and-related-request-apis)
+- [4. Date / Time / Duration values](#4-date--time--duration-values)
+- [5. `ExtendedBounds`](#5-extendedbounds)
+- [6. `Field.Format`](#6-fieldformat)
+- [7. `Field`/`Fields` semantics](#7-fieldfields-semantics)
+- [8. `FieldValue`](#8-fieldvalue)
+- [9. `FieldSort`](#9-fieldsort)
+- [10. Descriptor types `class` -\> `struct`](#10-descriptor-types-class---struct)
+
+### Breaking changes
+
+#### 1. Container types
+
+**Impact**: High.
+
+Container types now use regular properties for their variants instead of static factory methods ([read more](index.md#7-improved-container-design)).
+
+This change primarily affects the `Query` and `Aggregation` types.
+
+```csharp
+// 8.x
+new SearchRequest
+{
+ Query = Query.MatchAll(
+ new MatchAllQuery
+ {
+ }
+ )
+};
+
+// 9.0
+new SearchRequest
+{
+ Query = new Query
+ {
+ MatchAll = new MatchAllQuery
+ {
+ }
+ }
+};
+```
+
+#### 2. Removal of certain generic request descriptors
+
+**Impact**: High.
+
+Removed the generic version of some request descriptors for which the corresponding requests do not contain inferrable properties.
+
+These descriptors were generated unintentionally.
+
+When migrating, the generic type parameter must be removed from the type, e.g., `AsyncSearchStatusRequestDescriptor` should become just `AsyncSearchStatusRequestDescriptor`.
+
+List of affected descriptors:
+
+- `AsyncQueryDeleteRequestDescriptor`
+- `AsyncQueryGetRequestDescriptor`
+- `AsyncSearchStatusRequestDescriptor`
+- `DatabaseConfigurationDescriptor`
+- `DatabaseConfigurationFullDescriptor`
+- `DeleteAsyncRequestDescriptor`
+- `DeleteAsyncSearchRequestDescriptor`
+- `DeleteDataFrameAnalyticsRequestDescriptor`
+- `DeleteGeoipDatabaseRequestDescriptor`
+- `DeleteIpLocationDatabaseRequestDescriptor`
+- `DeleteJobRequestDescriptor`
+- `DeletePipelineRequestDescriptor`
+- `DeleteScriptRequestDescriptor`
+- `DeleteSynonymRequestDescriptor`
+- `EqlDeleteRequestDescriptor`
+- `EqlGetRequestDescriptor`
+- `GetAsyncRequestDescriptor`
+- `GetAsyncSearchRequestDescriptor`
+- `GetAsyncStatusRequestDescriptor`
+- `GetDataFrameAnalyticsRequestDescriptor`
+- `GetDataFrameAnalyticsStatsRequestDescriptor`
+- `GetEqlStatusRequestDescriptor`
+- `GetGeoipDatabaseRequestDescriptor`
+- `GetIpLocationDatabaseRequestDescriptor`
+- `GetJobsRequestDescriptor`
+- `GetPipelineRequestDescriptor`
+- `GetRollupCapsRequestDescriptor`
+- `GetRollupIndexCapsRequestDescriptor`
+- `GetScriptRequestDescriptor`
+- `GetSynonymRequestDescriptor`
+- `IndexModifyDataStreamActionDescriptor`
+- `PreprocessorDescriptor`
+- `PutGeoipDatabaseRequestDescriptor`
+- `PutIpLocationDatabaseRequestDescriptor`
+- `PutScriptRequestDescriptor`
+- `PutSynonymRequestDescriptor`
+- `QueryVectorBuilderDescriptor`
+- `RankDescriptor`
+- `RenderSearchTemplateRequestDescriptor`
+- `SmoothingModelDescriptor`
+- `StartDataFrameAnalyticsRequestDescriptor`
+- `StartJobRequestDescriptor`
+- `StopDataFrameAnalyticsRequestDescriptor`
+- `StopJobRequestDescriptor`
+- `TokenizationConfigDescriptor`
+- `UpdateDataFrameAnalyticsRequestDescriptor`
+
+#### 3. Removal of certain descriptor constructors and related request APIs
+
+**Impact**: High.
+
+Removed `(TDocument, IndexName)` descriptor constructors and related request APIs for all requests with `IndexName` and `Id` path parameters.
+
+For example:
+
+```csharp
+// 8.x
+public IndexRequestDescriptor(TDocument document, IndexName index, Id? id) { }
+public IndexRequestDescriptor(TDocument document, IndexName index) { }
+public IndexRequestDescriptor(TDocument document, Id? id) { }
+public IndexRequestDescriptor(TDocument document) { }
+
+// 9.0
+public IndexRequestDescriptor(TDocument document, IndexName index, Id? id) { }
+public IndexRequestDescriptor(TDocument document, Id? id) { }
+public IndexRequestDescriptor(TDocument document) { }
+```
+
+These overloads caused invocation ambiguities since both, `IndexName` and `Id` implement implicit conversion operators from `string`.
+
+Alternative with same semantics:
+
+```csharp
+// Descriptor constructor.
+new IndexRequestDescriptor(document, "my_index", Id.From(document));
+
+// Request API method.
+await client.IndexAsync(document, "my_index", Id.From(document), ...);
+```
+
+#### 4. Date / Time / Duration values
+
+**Impact**: High.
+
+In places where previously `long` or `double` was used to represent a date/time/duration value, `DateTimeOffset` or `TimeSpan` is now used instead.
+
+#### 5. `ExtendedBounds`
+
+**Impact**: High.
+
+Removed `ExtendedBoundsDate`/`ExtendedBoundsDateDescriptor`, `ExtendedBoundsFloat`/`ExtendedBoundsFloatDescriptor`.
+
+Replaced by `ExtendedBounds`, `ExtendedBoundsOfFieldDateMathDescriptor`, and `ExtendedBoundsOfDoubleDescriptor`.
+
+#### 6. `Field.Format`
+
+**Impact**: Low.
+
+Removed `Field.Format` property and corresponding constructor and inferrer overloads.
+
+This property has not been used for some time (replaced by the `FieldAndFormat` type).
+
+#### 7. `Field`/`Fields` semantics
+
+**Impact**: Low.
+
+`Field`/`Fields` static factory methods and conversion operators no longer return nullable references but throw exceptions instead (`Field`) if the input `string`/`Expression`/`PropertyInfo` argument is `null`.
+
+This makes implicit conversions to `Field` more user-friendly without requiring the null-forgiveness operator (`!`) ([read more](index.md#field-name-inference)).
+
+#### 8. `FieldValue`
+
+**Impact**: Low.
+
+Removed `FieldValue.IsLazyDocument`, `FieldValue.IsComposite`, and the corresponding members in the `FieldValue.ValueKind` enum.
+
+These values have not been used for some time.
+
+#### 9. `FieldSort`
+
+**Impact**: Low.
+
+Removed static `FieldSort.Empty` member.
+
+Sorting got reworked which makes this member obsolete ([read more](index.md#sorting)).
+
+#### 10. Descriptor types `class` -> `struct`
+
+**Impact**: Low.
+
+All descriptor types are now implemented as `struct` instead of `class`.
diff --git a/docs/release-notes/index.md b/docs/release-notes/index.md
index 414f025096e..2c5ead4c142 100644
--- a/docs/release-notes/index.md
+++ b/docs/release-notes/index.md
@@ -6,22 +6,388 @@ mapped_pages:
# Elasticsearch .NET Client release notes [elasticsearch-net-client-release-notes]
-Review the changes, fixes, and more in each version of Elasticsearch .NET Client.
+Review the changes, fixes, and more in each version of Elasticsearch .NET Client.
To check for security updates, go to [Security announcements for the Elastic stack](https://discuss.elastic.co/c/announcements/security-announcements/31).
-% Release notes include only features, enhancements, and fixes. Add breaking changes, deprecations, and known issues to the applicable release notes sections.
+% Release notes include only features, enhancements, and fixes. Add breaking changes, deprecations, and known issues to the applicable release notes sections.
% ## version.next [felasticsearch-net-client-next-release-notes]
% ### Features and enhancements [elasticsearch-net-client-next-features-enhancements]
-% *
+% *
% ### Fixes [elasticsearch-net-client-next-fixes]
-% *
+% *
## 9.0.0 [elasticsearch-net-client-900-release-notes]
-### Features and enhancements [elasticsearch-net-client-900-features-enhancements]
+### Overview
-### Fixes [elasticsearch-net-client-900-fixes]
\ No newline at end of file
+- [1. Request Method/API Changes](#1-request-methodapi-changes)
+ - [1.1. Synchronous Request APIs](#11-synchronous-request-apis)
+ - [1.2. Separate Type Arguments for Request/Response](#12-separate-type-arguments-for-requestresponse)
+- [2. Improved Fluent API](#2-improved-fluent-api)
+ - [2.1. `ICollection`](#21-icollectione)
+ - [2.2. `IDictionary`](#22-idictionaryk-v)
+ - [2.3. `ICollection>`](#23-icollectionkeyvaluepairk-v)
+ - [2.4. Union Types](#24-union-types)
+- [3. Improved Descriptor Design](#3-improved-descriptor-design)
+ - [3.1. Wrap](#31-wrap)
+ - [3.2. Unwrap / Inspect](#32-unwrap--inspect)
+ - [3.3. Removal of Side Effects](#33-removal-of-side-effects)
+- [4. Request Path Parameter Properties](#4-request-path-parameter-properties)
+- [5. Field Name Inference](#5-field-name-inference)
+- [6. Uniform Date/Time/Duration Types](#6-uniform-datetimeduration-types)
+- [7. Improved Container Design](#7-improved-container-design)
+- [8. Sorting](#8-sorting)
+- [9. Safer Object Creation](#9-safer-object-creation)
+- [10. Serialization](#10-serialization)
+
+### Features and enhancements
+
+#### 1. Request Method/API Changes
+
+##### 1.1. Synchronous Request APIs
+
+Synchronous request APIs are no longer marked as `obsolete`. We received some feedback about this deprecation and decided to revert it.
+
+##### 1.2. Separate Type Arguments for Request/Response
+
+It is now possible to specify separate type arguments for requests/responses when executing request methods:
+
+```csharp
+var response = await client.SearchAsync(x => x
+ .Query(x => x.Term(x => x.Field(x => x.FirstName).Value("Florian")))
+);
+
+var documents = response.Documents; <1>
+```
+
+1. `IReadOnlyCollection`
+
+The regular APIs with merged type arguments are still available.
+
+#### 2. Improved Fluent API
+
+The enhanced fluent API generation is likely the most notable change in the 9.0 client.
+
+This section describes the main syntax constructs generated based on the type of the property in the corresponding object.
+
+##### 2.1. `ICollection`
+
+Note: This syntax already existed in 8.x.
+
+```csharp
+new SearchRequestDescriptor()
+ .Query(q => q
+ .Bool(b => b
+ .Must(new Query()) // Scalar: Single element.
+ .Must(new Query(), new Query()) // Scalar: Multiple elements (params).
+ .Must(m => m.MatchAll()) // Fluent: Single element.
+ .Must(m => m.MatchAll(), m => m.MatchNone()) // Fluent: Multiple elements (params).
+ )
+ );
+```
+
+##### 2.2. `IDictionary`
+
+The 9.0 client introduces full fluent API support for dictionary types.
+
+```csharp
+new SearchRequestDescriptor()
+ .Aggregations(new Dictionary()) // Scalar.
+ .Aggregations(aggs => aggs // Fluent: Nested.
+ .Add("key", new MaxAggregation()) // Scalar: Key + Value.
+ .Add("key", x => x.Max()) // Fluent: Key + Value.
+ )
+ .AddAggregation("key", new MaxAggregation()) // Scalar.
+ .AddAggregation("key", x => x.Max()); // Fluent.
+```
+
+:::{warning}
+
+The `Add{Element}` methods have different semantics compared to the standard setter methods.
+
+Standard fluent setters set or **replace** a value.
+
+In contrast, the new additive methods append new elements to the dictionary.
+
+:::
+
+For dictionaries where the value type does not contain required properties that must be initialized, another syntax is generated that allows easy addition of new entries by just specifying the key:
+
+```csharp
+// Dictionary()
+
+new CreateIndexRequestDescriptor("index")
+ // ... all previous overloads ...
+ .Aliases(aliases => aliases // Fluent: Nested.
+ .Add("key") // Key only.
+ )
+ .Aliases("key") // Key only: Single element.
+ .Aliases("first", "second") // Key only: Multiple elements (params).
+```
+
+If the value type in the dictionary is a collection, additional `params` overloads are generated:
+
+```csharp
+// Dictionary>
+
+new CompletionSuggesterDescriptor()
+ // ... all previous overloads ...
+ .AddContext("key",
+ new CompletionContext{ Context = new Context("first") },
+ new CompletionContext{ Context = new Context("second") }
+ )
+ .AddContext("key",
+ x => x.Context(x => x.Category("first")),
+ x => x.Context(x => x.Category("second"))
+ );
+```
+
+##### 2.3. `ICollection>`
+
+Elasticsearch often uses `ICollection>` types for ordered dictionaries.
+
+The 9.0 client abstracts this implementation detail by providing a fluent API that can be used exactly like the one for `IDictionary` types:
+
+```csharp
+new PutMappingRequestDescriptor("index")
+ .DynamicTemplates(new List>()) // Scalar.
+ .DynamicTemplates(x => x // Fluent: Nested.
+ .Add("key", new DynamicTemplate()) // Scalar: Key + Value.
+ .Add("key", x => x.Mapping(new TextProperty())) // Fluent: Key + Value.
+ )
+ .AddDynamicTemplate("key", new DynamicTemplate()) // Scalar: Key + Value.
+ .AddDynamicTemplate("key", x => x.Runtime(x => x.Format("123"))); // Fluent: Key + Value.
+```
+
+##### 2.4. Union Types
+
+Fluent syntax is now as well available for all auto-generated union- and variant-types.
+
+```csharp
+// TermsQueryField : Union, TermsLookup>
+
+new TermsQueryDescriptor()
+ .Terms(x => x.Value("a", "b", "c")) <1>
+ .Terms(x => x.Lookup(x => x.Index("index").Id("id"))); <2>
+```
+
+1. `ICollection`
+2. `TermsLookup`
+
+#### 3. Improved Descriptor Design
+
+The 9.0 release features a completely overhauled descriptor design.
+
+Descriptors now wrap the object representation. This brings several internal quality-of-life improvements as well as noticeable benefits to end-users.
+
+##### 3.1. Wrap
+
+Use the wrap constructor to create a new descriptor for an existing object:
+
+```csharp
+var request = new SearchRequest();
+
+// Wrap.
+var descriptor = new SearchRequestDescriptor(request);
+```
+
+All fluent methods of the descriptor will mutate the existing `request` passed to the wrap constructor.
+
+:::{note}
+
+Descriptors are now implemented as `struct` instead of `class`, reducing allocation overhead as much as possible.
+
+:::
+
+##### 3.2. Unwrap / Inspect
+
+Descriptor values can now be inspected by unwrapping the object using an implicit conversion operator:
+
+```csharp
+var descriptor = new SearchRequestDescriptor();
+
+// Unwrap.
+SearchRequest request = descriptor;
+```
+
+Unwrapping does not allocate or copy.
+
+##### 3.3. Removal of Side Effects
+
+In 8.x, execution of (most but not all) lambda actions passed to descriptors was deferred until the actual request was made. It was never clear to the user when, and how often an action would be executed.
+
+In 9.0, descriptor actions are always executed immediately. This ensures no unforeseen side effects occur if the user-provided lambda action mutates external state (it is still recommended to exclusively use pure/invariant actions). Consequently, the effects of all changes performed by a descriptor method are immediately applied to the wrapped object.
+
+#### 4. Request Path Parameter Properties
+
+In 8.x, request path parameters like `Index`, `Id`, etc. could only be set by calling the corresponding constructor of the request. Afterwards, there was no way to read or change the current value.
+
+In the 9.0 client, all request path parameters are exposed as `get/set` properties, allowing for easy access:
+
+```csharp
+// 8.x and 9.0
+var request = new SearchRequest(Indices.All);
+
+// 9.0
+var request = new SearchRequest { Indices = Indices.All };
+var indices = request.Indices;
+request.Indices = "my_index";
+```
+
+#### 5. Field Name Inference
+
+The `Field` type and especially its implicit conversion operations allowed for `null` return values. This led to a poor developer experience, as the null-forgiveness operator (`!`) had to be used frequently without good reason.
+
+This is no longer required in 9.0:
+
+```csharp
+// 8.x
+Field field = "field"!;
+
+// 9.0
+Field field = "field";
+```
+
+#### 6. Uniform Date/Time/Duration Types
+
+The encoding of date, time and duration values in Elasticsearch often varies depending on the context. In addition to string representations in ISO 8601 and RFC 3339 format (always UTC), also Unix timestamps (in seconds, milliseconds, nanoseconds) or simply seconds, milliseconds, nanoseconds are frequently used.
+
+In 8.x, some date/time values are already mapped as `DateTimeOffset`, but the various non-ISO/RFC representations were not.
+
+9.0 now represents all date/time values uniformly as `DateTimeOffset` and also uses the native `TimeSpan` type for all durations.
+
+:::{note}
+
+There are some places where the Elasticsearch custom date/time/duration types are continued to be used. This is always the case when the type has special semantics and/or offers functionality that goes beyond that of the native date/time/duration types (e.g. `Duration`, `DateMath`).
+
+:::
+
+#### 7. Improved Container Design
+
+In 8.x, container types like `Query` or `Aggregation` had to be initialized using static factory methods.
+
+```csharp
+// 8.x
+var agg = Aggregation.Max(new MaxAggregation { Field = "my_field" });
+```
+
+This made it mandatory to assign the created container to a temporary variable if additional properties of the container (not the contained variant) needed to be set:
+
+```csharp
+// 8.x
+var agg = Aggregation.Max(new MaxAggregation { Field = "my_field" });
+agg.Aggregations ??= new Dictionary();
+agg.Aggregations.Add("my_sub_agg", Aggregation.Terms(new TermsAggregation()));
+```
+
+Additionally, it was not possible to inspect the contained variant.
+
+In 9.0, each possible container variant is represented as a regular property of the container. This allows for determining and inspecting the contained variant and initializing container properties in one go when using an object initializer:
+
+```csharp
+// 9.0
+var agg = new Aggregation
+{
+ Max = new MaxAggregation { Field = "my_field" },
+ Aggregations = new Dictionary
+ {
+ { "my_sub_agg", new Aggregation{ Terms = new TermsAggregation() } }
+ }
+};
+```
+
+:::{warning}
+
+A container can still only contain a single variant. Setting multiple variants at once is invalid.
+
+Consecutive assignments of variant properties (e.g., first setting `Max`, then `Min`) will cause the previous variant to be replaced.
+
+:::
+
+#### 8. Sorting
+
+Applying a sort order to a search request using the fluent API is now more convenient:
+
+```csharp
+var search = new SearchRequestDescriptor()
+ .Sort(
+ x => x.Score(),
+ x => x.Score(x => x.Order(SortOrder.Desc)),
+ x => x.Field(x => x.FirstName),
+ x => x.Field(x => x.Age, x => x.Order(SortOrder.Desc)),
+ x => x.Field(x => x.Age, SortOrder.Desc)
+ // 7.x syntax
+ x => x.Field(x => x.Field(x => x.FirstName).Order(SortOrder.Desc))
+ );
+```
+
+The improvements are even more evident when specifying a sort order for aggregations:
+
+```csharp
+new SearchRequestDescriptor()
+ .Aggregations(aggs => aggs
+ .Add("my_terms", agg => agg
+ .Terms(terms => terms
+ // 8.x syntax.
+ .Order(new List>
+ {
+ new KeyValuePair("_key", SortOrder.Desc)
+ })
+ // 9.0 fluent syntax.
+ .Order(x => x
+ .Add(x => x.Age, SortOrder.Asc)
+ .Add("_key", SortOrder.Desc)
+ )
+ // 9.0 fluent add syntax (valid for all dictionary-like values).
+ .AddOrder("_key", SortOrder.Desc)
+ )
+ )
+ );
+```
+
+#### 9. Safer Object Creation
+
+In version 9.0, users are better guided to correctly initialize objects and thus prevent invalid requests.
+
+For this purpose, at least one constructor is now created that enforces the initialization of all required properties. Existing parameterless constructors or constructor variants that allow the creation of incomplete objects are preserved for backwards compatibility reasons, but are marked as obsolete.
+
+For NET7+ TFMs, required properties are marked with the `required` keyword, and a non-deprecated parameterless constructor is unconditionally generated.
+
+:::{note}
+
+Please note that the use of descriptors still provides the chance to create incomplete objects/requests, as descriptors do not enforce the initialization of all required properties for usability reasons.
+
+:::
+
+#### 10. Serialization
+
+Serialization in version 9.0 has been completely overhauled, with a primary focus on robustness and performance. Additionally, initial milestones have been set for future support of native AOT.
+
+In 9.0, round-trip serialization is now supported for all types (limited to all JSON serializable types).
+
+```csharp
+var request = new SearchRequest{ /* ... */ };
+
+var json = client.ElasticsearchClientSettings.RequestResponseSerializer.SerializeToString(
+ request,
+ SerializationFormatting.Indented
+);
+
+var searchRequestBody = client.ElasticsearchClientSettings.RequestResponseSerializer.Deserialize(json)!;
+```
+
+:::{warning}
+
+Note that only the body is serialized for request types. Path- and query properties must be handled manually.
+
+:::
+
+:::{note}
+
+It is important to use the `RequestResponseSerializer` when (de-)serializing client internal types. Direct use of `JsonSerializer` will not work.
+
+:::
diff --git a/global.json b/global.json
index c1ae6f120d3..00b67caef9e 100644
--- a/global.json
+++ b/global.json
@@ -1,10 +1,7 @@
{
"sdk": {
- "version": "8.0.400",
+ "version": "9.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
- },
- "version": "8.8.0-alpha.1",
- "doc_current": "main",
- "doc_branch": "main"
+ }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/ConnectionSettingsAwareContractResolver.cs b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/ConnectionSettingsAwareContractResolver.cs
deleted file mode 100644
index 41b756d9aab..00000000000
--- a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/ConnectionSettingsAwareContractResolver.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-// 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.Reflection;
-using Elastic.Clients.Elasticsearch;
-using Elastic.Clients.Elasticsearch.QueryDsl;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
-using Newtonsoft.Json.Serialization;
-using JsonProperty = Newtonsoft.Json.Serialization.JsonProperty;
-
-namespace Elastic.Clients.Elasticsearch.JsonNetSerializer;
-
-public class ConnectionSettingsAwareContractResolver : DefaultContractResolver
-{
- public ConnectionSettingsAwareContractResolver(IElasticsearchClientSettings connectionSettings) =>
- ConnectionSettings = connectionSettings ?? throw new ArgumentNullException(nameof(connectionSettings));
-
- protected IElasticsearchClientSettings ConnectionSettings { get; }
-
- protected override string ResolvePropertyName(string fieldName) =>
- ConnectionSettings.DefaultFieldNameInferrer != null
- ? ConnectionSettings.DefaultFieldNameInferrer(fieldName)
- : base.ResolvePropertyName(fieldName);
-
- protected override JsonContract CreateContract(Type objectType)
- {
- var contract = base.CreateContract(objectType);
- if (objectType.IsEnum && objectType.GetCustomAttribute() != null)
- contract.Converter = new StringEnumConverter();
-
- return contract;
- }
-
- protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
- {
- var property = base.CreateProperty(member, memberSerialization);
- ApplyShouldSerializer(property);
- ApplyPropertyOverrides(member, property);
- return property;
- }
-
- /// Renames/Ignores a property based on the connection settings mapping or custom attributes for the property
- private void ApplyPropertyOverrides(MemberInfo member, JsonProperty property)
- {
- //if (!ConnectionSettings.PropertyMappings.TryGetValue(member, out var propertyMapping))
- // propertyMapping = ElasticsearchPropertyAttributeBase.From(member);
-
- var serializerMapping = ConnectionSettings.PropertyMappingProvider?.CreatePropertyMapping(member);
-
- var nameOverride = /*propertyMapping?.Name ??*/ serializerMapping?.Name;
- if (!string.IsNullOrWhiteSpace(nameOverride))
- property.PropertyName = nameOverride;
-
- var overrideIgnore = /*propertyMapping?.Ignore ??*/ serializerMapping?.Ignore;
- if (overrideIgnore.HasValue)
- property.Ignored = overrideIgnore.Value;
- }
-
- private static void ApplyShouldSerializer(JsonProperty property)
- {
- if (property.PropertyType == typeof(Query))
- property.ShouldSerialize = o => ShouldSerializeQuery(o, property);
- else if (property.PropertyType == typeof(IEnumerable))
- property.ShouldSerialize = o => ShouldSerializeQuerys(o, property);
- }
-
- private static bool ShouldSerializeQuery(object o, JsonProperty prop)
- {
- if (o == null)
- return false;
- if (prop.ValueProvider.GetValue(o) is not Query q)
- return false;
- //return q.IsWritable;
- return true;
- }
-
- private static bool ShouldSerializeQuerys(object o, JsonProperty prop)
- {
- if (o == null)
- return false;
- if (prop.ValueProvider.GetValue(o) is not IEnumerable q)
- return false;
-
- var queryContainers = q as Query[] ?? q.ToArray();
- //return queryContainers.Any(qq => qq != null && ((Query)qq).IsWritable);
- return queryContainers.Any(qq => qq != null);
- }
-}
diff --git a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/ConnectionSettingsAwareSerializerBase.Customization.cs b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/ConnectionSettingsAwareSerializerBase.Customization.cs
deleted file mode 100644
index 5df10b9d9d0..00000000000
--- a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/ConnectionSettingsAwareSerializerBase.Customization.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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.IO;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Elastic.Transport;
-using Newtonsoft.Json;
-
-namespace Elastic.Clients.Elasticsearch.JsonNetSerializer;
-
-public abstract partial class ConnectionSettingsAwareSerializer : Serializer
-{
- // Default buffer size of StreamWriter, which is private :(
- internal const int DefaultBufferSize = 1024;
-
- private static readonly Task CompletedTask = Task.CompletedTask;
-
- internal static readonly Encoding ExpectedEncoding = new UTF8Encoding(false);
- private readonly JsonSerializer _collapsedSerializer;
-
- private readonly JsonSerializer _serializer;
- protected virtual int BufferSize => DefaultBufferSize;
-
- public override T Deserialize(Stream stream)
- {
- using var streamReader = new StreamReader(stream);
- using var jsonTextReader = new JsonTextReader(streamReader);
- return _serializer.Deserialize(jsonTextReader);
- }
-
- public override object Deserialize(Type type, Stream stream)
- {
- using var streamReader = new StreamReader(stream);
- using var jsonTextReader = new JsonTextReader(streamReader);
- return _serializer.Deserialize(jsonTextReader, type);
- }
-
- public override async ValueTask DeserializeAsync(Stream stream, CancellationToken cancellationToken = default)
- {
- using var streamReader = new StreamReader(stream);
- using var jsonTextReader = new JsonTextReader(streamReader);
- var token = await jsonTextReader.ReadTokenWithDateParseHandlingNoneAsync(cancellationToken).ConfigureAwait(false);
- return token.ToObject(_serializer);
- }
-
- public override async ValueTask
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs
index 0fbea097dfe..6facc66b7f9 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs
@@ -17,6 +17,10 @@
#nullable restore
+using System;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
+
namespace Elastic.Clients.Elasticsearch.Requests;
internal static class ApiUrlLookup
@@ -63,6 +67,7 @@ internal static class ApiUrlLookup
internal static ApiUrls EsqlAsyncQuery = new ApiUrls(new[] { "_query/async" });
internal static ApiUrls EsqlAsyncQueryDelete = new ApiUrls(new[] { "_query/async/{id}" });
internal static ApiUrls EsqlAsyncQueryGet = new ApiUrls(new[] { "_query/async/{id}" });
+ internal static ApiUrls EsqlAsyncQueryStop = new ApiUrls(new[] { "_query/async/{id}/stop" });
internal static ApiUrls EsqlQuery = new ApiUrls(new[] { "_query" });
internal static ApiUrls FeaturesGetFeatures = new ApiUrls(new[] { "_features" });
internal static ApiUrls FeaturesResetFeatures = new ApiUrls(new[] { "_features/_reset" });
@@ -78,14 +83,16 @@ internal static class ApiUrlLookup
internal static ApiUrls IndexLifecycleManagementStart = new ApiUrls(new[] { "_ilm/start" });
internal static ApiUrls IndexLifecycleManagementStop = new ApiUrls(new[] { "_ilm/stop" });
internal static ApiUrls IndexManagementAnalyze = new ApiUrls(new[] { "_analyze", "{index}/_analyze" });
+ internal static ApiUrls IndexManagementCancelMigrateReindex = new ApiUrls(new[] { "_migration/reindex/{index}/_cancel" });
internal static ApiUrls IndexManagementClearCache = new ApiUrls(new[] { "_cache/clear", "{index}/_cache/clear" });
internal static ApiUrls IndexManagementClone = new ApiUrls(new[] { "{index}/_clone/{target}" });
internal static ApiUrls IndexManagementClose = new ApiUrls(new[] { "{index}/_close" });
internal static ApiUrls IndexManagementCreate = new ApiUrls(new[] { "{index}" });
internal static ApiUrls IndexManagementCreateDataStream = new ApiUrls(new[] { "_data_stream/{name}" });
+ internal static ApiUrls IndexManagementCreateFrom = new ApiUrls(new[] { "_create_from/{source}/{dest}" });
internal static ApiUrls IndexManagementDataStreamsStats = new ApiUrls(new[] { "_data_stream/_stats", "_data_stream/{name}/_stats" });
internal static ApiUrls IndexManagementDelete = new ApiUrls(new[] { "{index}" });
- internal static ApiUrls IndexManagementDeleteAlias = new ApiUrls(new[] { "{index}/_alias/{name}", "{index}/_aliases/{name}" });
+ 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 IndexManagementDeleteIndexTemplate = new ApiUrls(new[] { "_index_template/{name}" });
@@ -108,13 +115,15 @@ internal static class ApiUrlLookup
internal static ApiUrls IndexManagementGetFieldMapping = new ApiUrls(new[] { "_mapping/field/{fields}", "{index}/_mapping/field/{fields}" });
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 IndexManagementGetMigrateReindexStatus = new ApiUrls(new[] { "_migration/reindex/{index}/_status" });
internal static ApiUrls IndexManagementGetSettings = new ApiUrls(new[] { "_settings", "{index}/_settings", "{index}/_settings/{name}", "_settings/{name}" });
internal static ApiUrls IndexManagementGetTemplate = new ApiUrls(new[] { "_template", "_template/{name}" });
+ internal static ApiUrls IndexManagementMigrateReindex = new ApiUrls(new[] { "_migration/reindex" });
internal static ApiUrls IndexManagementMigrateToDataStream = new ApiUrls(new[] { "_data_stream/_migrate/{name}" });
internal static ApiUrls IndexManagementModifyDataStream = new ApiUrls(new[] { "_data_stream/_modify" });
internal static ApiUrls IndexManagementOpen = new ApiUrls(new[] { "{index}/_open" });
internal static ApiUrls IndexManagementPromoteDataStream = new ApiUrls(new[] { "_data_stream/_promote/{name}" });
- internal static ApiUrls IndexManagementPutAlias = new ApiUrls(new[] { "{index}/_alias/{name}", "{index}/_aliases/{name}" });
+ 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" });
@@ -123,7 +132,7 @@ internal static class ApiUrlLookup
internal static ApiUrls IndexManagementRecovery = new ApiUrls(new[] { "_recovery", "{index}/_recovery" });
internal static ApiUrls IndexManagementRefresh = new ApiUrls(new[] { "_refresh", "{index}/_refresh" });
internal static ApiUrls IndexManagementReloadSearchAnalyzers = new ApiUrls(new[] { "{index}/_reload_search_analyzers" });
- internal static ApiUrls IndexManagementResolveCluster = new ApiUrls(new[] { "_resolve/cluster/{name}" });
+ internal static ApiUrls IndexManagementResolveCluster = new ApiUrls(new[] { "_resolve/cluster", "_resolve/cluster/{name}" });
internal static ApiUrls IndexManagementResolveIndex = new ApiUrls(new[] { "_resolve/index/{name}" });
internal static ApiUrls IndexManagementRollover = new ApiUrls(new[] { "{alias}/_rollover", "{alias}/_rollover/{new_index}" });
internal static ApiUrls IndexManagementSegments = new ApiUrls(new[] { "_segments", "{index}/_segments" });
@@ -135,11 +144,31 @@ internal static class ApiUrlLookup
internal static ApiUrls IndexManagementStats = new ApiUrls(new[] { "_stats", "_stats/{metric}", "{index}/_stats", "{index}/_stats/{metric}" });
internal static ApiUrls IndexManagementUpdateAliases = new ApiUrls(new[] { "_aliases" });
internal static ApiUrls IndexManagementValidateQuery = new ApiUrls(new[] { "_validate/query", "{index}/_validate/query" });
+ internal static ApiUrls InferenceChatCompletionUnified = new ApiUrls(new[] { "_inference/chat_completion/{inference_id}/_stream" });
+ internal static ApiUrls InferenceCompletion = new ApiUrls(new[] { "_inference/completion/{inference_id}" });
internal static ApiUrls InferenceDelete = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" });
internal static ApiUrls InferenceGet = new ApiUrls(new[] { "_inference", "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" });
- internal static ApiUrls InferenceInference = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" });
internal static ApiUrls InferencePut = new ApiUrls(new[] { "_inference/{inference_id}", "_inference/{task_type}/{inference_id}" });
- internal static ApiUrls InferenceStreamInference = new ApiUrls(new[] { "_inference/{inference_id}/_stream", "_inference/{task_type}/{inference_id}/_stream" });
+ internal static ApiUrls InferencePutAlibabacloud = new ApiUrls(new[] { "_inference/{task_type}/{alibabacloud_inference_id}" });
+ internal static ApiUrls InferencePutAmazonbedrock = new ApiUrls(new[] { "_inference/{task_type}/{amazonbedrock_inference_id}" });
+ internal static ApiUrls InferencePutAnthropic = new ApiUrls(new[] { "_inference/{task_type}/{anthropic_inference_id}" });
+ internal static ApiUrls InferencePutAzureaistudio = new ApiUrls(new[] { "_inference/{task_type}/{azureaistudio_inference_id}" });
+ internal static ApiUrls InferencePutAzureopenai = new ApiUrls(new[] { "_inference/{task_type}/{azureopenai_inference_id}" });
+ internal static ApiUrls InferencePutCohere = new ApiUrls(new[] { "_inference/{task_type}/{cohere_inference_id}" });
+ internal static ApiUrls InferencePutElasticsearch = new ApiUrls(new[] { "_inference/{task_type}/{elasticsearch_inference_id}" });
+ internal static ApiUrls InferencePutElser = new ApiUrls(new[] { "_inference/{task_type}/{elser_inference_id}" });
+ internal static ApiUrls InferencePutGoogleaistudio = new ApiUrls(new[] { "_inference/{task_type}/{googleaistudio_inference_id}" });
+ internal static ApiUrls InferencePutGooglevertexai = new ApiUrls(new[] { "_inference/{task_type}/{googlevertexai_inference_id}" });
+ internal static ApiUrls InferencePutHuggingFace = new ApiUrls(new[] { "_inference/{task_type}/{huggingface_inference_id}" });
+ internal static ApiUrls InferencePutJinaai = new ApiUrls(new[] { "_inference/{task_type}/{jinaai_inference_id}" });
+ internal static ApiUrls InferencePutMistral = new ApiUrls(new[] { "_inference/{task_type}/{mistral_inference_id}" });
+ internal static ApiUrls InferencePutOpenai = new ApiUrls(new[] { "_inference/{task_type}/{openai_inference_id}" });
+ internal static ApiUrls InferencePutVoyageai = new ApiUrls(new[] { "_inference/{task_type}/{voyageai_inference_id}" });
+ internal static ApiUrls InferencePutWatsonx = new ApiUrls(new[] { "_inference/{task_type}/{watsonx_inference_id}" });
+ internal static ApiUrls InferenceRerank = new ApiUrls(new[] { "_inference/rerank/{inference_id}" });
+ internal static ApiUrls InferenceSparseEmbedding = new ApiUrls(new[] { "_inference/sparse_embedding/{inference_id}" });
+ internal static ApiUrls InferenceStreamCompletion = new ApiUrls(new[] { "_inference/completion/{inference_id}/_stream" });
+ internal static ApiUrls InferenceTextEmbedding = new ApiUrls(new[] { "_inference/text_embedding/{inference_id}" });
internal static ApiUrls InferenceUpdate = new ApiUrls(new[] { "_inference/{inference_id}/_update", "_inference/{task_type}/{inference_id}/_update" });
internal static ApiUrls IngestDeleteGeoipDatabase = new ApiUrls(new[] { "_ingest/geoip/database/{id}" });
internal static ApiUrls IngestDeleteIpLocationDatabase = new ApiUrls(new[] { "_ingest/ip_location/database/{id}" });
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs
index ed385a30bf7..d4fb5f65fde 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusRequest.g.cs
@@ -17,48 +17,94 @@
#nullable restore
-using Elastic.Clients.Elasticsearch.Fluent;
-using Elastic.Clients.Elasticsearch.Requests;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Elastic.Transport;
-using Elastic.Transport.Extensions;
using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Text.Json;
-using System.Text.Json.Serialization;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
-public sealed partial class AsyncSearchStatusRequestParameters : RequestParameters
+public sealed partial class AsyncSearchStatusRequestParameters : Elastic.Transport.RequestParameters
{
///
///
- /// Specifies how long the async search needs to be available.
+ /// The length of time that the async search needs to be available.
/// Ongoing async searches and any saved search results are deleted after this period.
///
///
public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
}
+internal sealed partial class AsyncSearchStatusRequestConverter : System.Text.Json.Serialization.JsonConverter
+{
+ public override Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
+ {
+ reader.Skip();
+ continue;
+ }
+
+ throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
+ }
+
+ reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
+ return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
+ {
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteEndObject();
+ }
+}
+
///
///
/// Get the async search status.
///
///
/// Get 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.
+/// If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:
+///
+///
+/// -
+///
+/// The user or API key that submitted the original async search request.
+///
+///
+/// -
+///
+/// Users that have the monitor cluster privilege or greater privileges.
///
+///
+///
///
-public sealed partial class AsyncSearchStatusRequest : PlainRequest
+[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestConverter))]
+public sealed partial class AsyncSearchStatusRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest
{
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
+#if NET7_0_OR_GREATER
+ public AsyncSearchStatusRequest()
+ {
+ }
+#endif
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ internal AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
+ {
+ _ = sentinel;
+ }
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;
+ internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.AsyncSearchStatus;
- protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+ protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET;
internal override bool SupportsBody => false;
@@ -66,11 +112,21 @@ public AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Id id) : base(r =>
///
///
- /// Specifies how long the async search needs to be available.
+ /// A unique identifier for the async search.
+ ///
+ ///
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ Elastic.Clients.Elasticsearch.Id Id { get => P("id"); set => PR("id", value); }
+
+ ///
+ ///
+ /// The length of time that 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.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
}
@@ -80,72 +136,115 @@ public AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Id id) : base(r =>
///
///
/// Get 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.
+/// If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:
+///
+///
+/// -
+///
+/// The user or API key that submitted the original async search request.
///
+///
+/// -
+///
+/// Users that have the monitor cluster privilege or greater privileges.
+///
+///
+///
///
-public sealed partial class AsyncSearchStatusRequestDescriptor : RequestDescriptor, AsyncSearchStatusRequestParameters>
+public readonly partial struct AsyncSearchStatusRequestDescriptor
{
- internal AsyncSearchStatusRequestDescriptor(Action> configure) => configure.Invoke(this);
+ internal Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest Instance { get; init; }
- public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest instance)
{
+ Instance = instance;
}
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;
-
- protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
-
- internal override bool SupportsBody => false;
+ public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id)
+ {
+ Instance = new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest(id);
+ }
- internal override string OperationName => "async_search.status";
+ [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")]
+ public AsyncSearchStatusRequestDescriptor()
+ {
+ throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type.");
+ }
- public AsyncSearchStatusRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Duration? keepAlive) => Qs("keep_alive", keepAlive);
+ public static explicit operator Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest instance) => new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor(instance);
+ public static implicit operator Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor descriptor) => descriptor.Instance;
- public AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
+ ///
+ ///
+ /// A unique identifier for the async search.
+ ///
+ ///
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id value)
{
- RouteValues.Required("id", id);
- return Self;
+ Instance.Id = value;
+ return this;
}
- protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ ///
+ ///
+ /// The length of time that the async search needs to be available.
+ /// Ongoing async searches and any saved search results are deleted after this period.
+ ///
+ ///
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Duration? value)
{
+ Instance.KeepAlive = value;
+ return this;
}
-}
-///
-///
-/// Get the async search status.
-///
-///
-/// Get 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.Id id) : base(r => r.Required("id", id))
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+ internal static Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest Build(System.Action action)
{
+ var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor(new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
+ action.Invoke(builder);
+ return builder.Instance;
}
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchStatus;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor ErrorTrace(bool? value)
+ {
+ Instance.ErrorTrace = value;
+ return this;
+ }
- protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor FilterPath(params string[]? value)
+ {
+ Instance.FilterPath = value;
+ return this;
+ }
- internal override bool SupportsBody => false;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor Human(bool? value)
+ {
+ Instance.Human = value;
+ return this;
+ }
- internal override string OperationName => "async_search.status";
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor Pretty(bool? value)
+ {
+ Instance.Pretty = value;
+ return this;
+ }
- public AsyncSearchStatusRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Duration? keepAlive) => Qs("keep_alive", keepAlive);
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor SourceQueryString(string? value)
+ {
+ Instance.SourceQueryString = value;
+ return this;
+ }
- public AsyncSearchStatusRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value)
{
- RouteValues.Required("id", id);
- return Self;
+ Instance.RequestConfiguration = value;
+ return this;
}
- protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ public Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor RequestConfiguration(System.Func? configurationSelector)
{
+ Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration;
+ return this;
}
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
index 126481dc53a..be4446982ec 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs
@@ -17,58 +17,202 @@
#nullable restore
-using Elastic.Clients.Elasticsearch.Fluent;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Elastic.Transport.Products.Elasticsearch;
using System;
-using System.Collections.Generic;
-using System.Text.Json.Serialization;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
-public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
+internal sealed partial class AsyncSearchStatusResponseConverter : System.Text.Json.Serialization.JsonConverter
+{
+ private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("_clusters");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionStatus = System.Text.Json.JsonEncodedText.Encode("completion_status");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTime = System.Text.Json.JsonEncodedText.Encode("completion_time");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTimeInMillis = System.Text.Json.JsonEncodedText.Encode("completion_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTime = System.Text.Json.JsonEncodedText.Encode("expiration_time");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTimeInMillis = System.Text.Json.JsonEncodedText.Encode("expiration_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id");
+ private static readonly System.Text.Json.JsonEncodedText PropIsPartial = System.Text.Json.JsonEncodedText.Encode("is_partial");
+ private static readonly System.Text.Json.JsonEncodedText PropIsRunning = System.Text.Json.JsonEncodedText.Encode("is_running");
+ private static readonly System.Text.Json.JsonEncodedText PropShards = System.Text.Json.JsonEncodedText.Encode("_shards");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis");
+
+ public override Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonValue propClusters = default;
+ LocalJsonValue propCompletionStatus = default;
+ LocalJsonValue propCompletionTime = default;
+ LocalJsonValue propCompletionTimeInMillis = default;
+ LocalJsonValue propExpirationTime = default;
+ LocalJsonValue propExpirationTimeInMillis = default;
+ LocalJsonValue propId = default;
+ LocalJsonValue propIsPartial = default;
+ LocalJsonValue propIsRunning = default;
+ LocalJsonValue propShards = default;
+ LocalJsonValue propStartTime = default;
+ LocalJsonValue propStartTimeInMillis = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propClusters.TryReadProperty(ref reader, options, PropClusters, null))
+ {
+ continue;
+ }
+
+ if (propCompletionStatus.TryReadProperty(ref reader, options, PropCompletionStatus, null))
+ {
+ continue;
+ }
+
+ if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))))
+ {
+ continue;
+ }
+
+ if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))))
+ {
+ continue;
+ }
+
+ if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))))
+ {
+ continue;
+ }
+
+ if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))))
+ {
+ continue;
+ }
+
+ if (propId.TryReadProperty(ref reader, options, PropId, null))
+ {
+ continue;
+ }
+
+ if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null))
+ {
+ continue;
+ }
+
+ if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null))
+ {
+ continue;
+ }
+
+ if (propShards.TryReadProperty(ref reader, options, PropShards, null))
+ {
+ continue;
+ }
+
+ if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))))
+ {
+ continue;
+ }
+
+ if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))))
+ {
+ continue;
+ }
+
+ if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
+ {
+ reader.Skip();
+ continue;
+ }
+
+ throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
+ }
+
+ reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
+ return new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
+ {
+ Clusters = propClusters.Value,
+ CompletionStatus = propCompletionStatus.Value,
+ CompletionTime = propCompletionTime.Value,
+ CompletionTimeInMillis = propCompletionTimeInMillis.Value,
+ ExpirationTime = propExpirationTime.Value,
+ ExpirationTimeInMillis = propExpirationTimeInMillis.Value,
+ Id = propId.Value,
+ IsPartial = propIsPartial.Value,
+ IsRunning = propIsRunning.Value,
+ Shards = propShards.Value,
+ StartTime = propStartTime.Value,
+ StartTimeInMillis = propStartTimeInMillis.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropClusters, value.Clusters, null, null);
+ writer.WriteProperty(options, PropCompletionStatus, value.CompletionStatus, null, null);
+ writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)));
+ writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)));
+ writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)));
+ writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)));
+ writer.WriteProperty(options, PropId, value.Id, null, null);
+ writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null);
+ writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null);
+ writer.WriteProperty(options, PropShards, value.Shards, null, null);
+ writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)));
+ writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)));
+ writer.WriteEndObject();
+ }
+}
+
+[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponseConverter))]
+public sealed partial class AsyncSearchStatusResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse
{
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ public AsyncSearchStatusResponse()
+ {
+ }
+
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ internal AsyncSearchStatusResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
+ {
+ _ = sentinel;
+ }
+
///
///
/// Metadata about clusters involved in the cross-cluster search.
- /// Not shown for local-only searches.
+ /// It is not shown for local-only searches.
///
///
- [JsonInclude, JsonPropertyName("_clusters")]
- public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; init; }
+ public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; set; }
///
///
/// 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.
+ /// 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; }
+ public int? CompletionStatus { get; set; }
///
///
- /// Indicates when the async search completed. Only present
- /// when the search has completed.
+ /// Indicates when the async search completed.
+ /// It is present only when the search has completed.
///
///
- [JsonInclude, JsonPropertyName("completion_time")]
- public DateTimeOffset? CompletionTime { get; init; }
- [JsonInclude, JsonPropertyName("completion_time_in_millis")]
- public long? CompletionTimeInMillis { get; init; }
+ public System.DateTimeOffset? CompletionTime { get; set; }
+ public System.DateTimeOffset? CompletionTimeInMillis { get; set; }
///
///
/// Indicates when the async search will expire.
///
///
- [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; }
+ public System.DateTimeOffset? ExpirationTime { get; set; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ System.DateTimeOffset ExpirationTimeInMillis { get; set; }
+ public string? Id { get; set; }
///
///
@@ -76,27 +220,41 @@ public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
/// While the query is running, is_partial is always set to true.
///
///
- [JsonInclude, JsonPropertyName("is_partial")]
- public bool IsPartial { get; init; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ bool IsPartial { get; set; }
///
///
/// Indicates whether the search is still running or has completed.
- /// NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.
+ ///
+ ///
+ /// info
+ /// If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.
///
///
- [JsonInclude, JsonPropertyName("is_running")]
- public bool IsRunning { get; init; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ bool IsRunning { get; set; }
///
///
- /// Indicates how many shards have run the query so far.
+ /// The number of shards that have run the query so far.
///
///
- [JsonInclude, JsonPropertyName("_shards")]
- public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; }
- [JsonInclude, JsonPropertyName("start_time")]
- public DateTimeOffset? StartTime { get; init; }
- [JsonInclude, JsonPropertyName("start_time_in_millis")]
- public long StartTimeInMillis { get; init; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; set; }
+ public System.DateTimeOffset? StartTime { get; set; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ System.DateTimeOffset StartTimeInMillis { get; set; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs
index e59001fda74..0d1d5481707 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchRequest.g.cs
@@ -17,21 +17,43 @@
#nullable restore
-using Elastic.Clients.Elasticsearch.Fluent;
-using Elastic.Clients.Elasticsearch.Requests;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Elastic.Transport;
-using Elastic.Transport.Extensions;
using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Text.Json;
-using System.Text.Json.Serialization;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
-public sealed partial class DeleteAsyncSearchRequestParameters : RequestParameters
+public sealed partial class DeleteAsyncSearchRequestParameters : Elastic.Transport.RequestParameters
+{
+}
+
+internal sealed partial class DeleteAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter
{
+ public override Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
+ {
+ reader.Skip();
+ continue;
+ }
+
+ throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
+ }
+
+ reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
+ return new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
+ {
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteEndObject();
+ }
}
///
@@ -44,19 +66,42 @@ public sealed partial class DeleteAsyncSearchRequestParameters : RequestParamete
/// 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
+[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestConverter))]
+public sealed partial class DeleteAsyncSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest
{
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
+#if NET7_0_OR_GREATER
+ public DeleteAsyncSearchRequest()
+ {
+ }
+#endif
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ internal DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
+ {
+ _ = sentinel;
+ }
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;
+ internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.AsyncSearchDelete;
- protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;
+ protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.DELETE;
internal override bool SupportsBody => false;
internal override string OperationName => "async_search.delete";
+
+ ///
+ ///
+ /// A unique identifier for the async search.
+ ///
+ ///
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ Elastic.Clients.Elasticsearch.Id Id { get => P("id"); set => PR("id", value); }
}
///
@@ -69,66 +114,88 @@ public DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r =>
/// 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>
+public readonly partial struct DeleteAsyncSearchRequestDescriptor
{
- internal DeleteAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this);
+ internal Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest Instance { get; init; }
- public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest instance)
{
+ Instance = instance;
}
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;
-
- protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;
+ public DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id)
+ {
+ Instance = new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest(id);
+ }
- internal override bool SupportsBody => false;
+ [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")]
+ public DeleteAsyncSearchRequestDescriptor()
+ {
+ throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type.");
+ }
- internal override string OperationName => "async_search.delete";
+ public static explicit operator Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest instance) => new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor(instance);
+ public static implicit operator Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor descriptor) => descriptor.Instance;
- public DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
+ ///
+ ///
+ /// A unique identifier for the async search.
+ ///
+ ///
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id value)
{
- RouteValues.Required("id", id);
- return Self;
+ Instance.Id = value;
+ return this;
}
- protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+ internal static Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest Build(System.Action action)
{
+ var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor(new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
+ action.Invoke(builder);
+ return builder.Instance;
}
-}
-///
-///
-/// Delete an async search.
-///
-///
-/// If the asynchronous search is still running, it is 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.Id id) : base(r => r.Required("id", id))
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor ErrorTrace(bool? value)
{
+ Instance.ErrorTrace = value;
+ return this;
}
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchDelete;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor FilterPath(params string[]? value)
+ {
+ Instance.FilterPath = value;
+ return this;
+ }
- protected override HttpMethod StaticHttpMethod => HttpMethod.DELETE;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor Human(bool? value)
+ {
+ Instance.Human = value;
+ return this;
+ }
- internal override bool SupportsBody => false;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor Pretty(bool? value)
+ {
+ Instance.Pretty = value;
+ return this;
+ }
- internal override string OperationName => "async_search.delete";
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor SourceQueryString(string? value)
+ {
+ Instance.SourceQueryString = value;
+ return this;
+ }
- public DeleteAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value)
{
- RouteValues.Required("id", id);
- return Self;
+ Instance.RequestConfiguration = value;
+ return this;
}
- protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ public Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor RequestConfiguration(System.Func? configurationSelector)
{
+ Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration;
+ return this;
}
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
index ea208db9469..2607a4672c7 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/DeleteAsyncSearchResponse.g.cs
@@ -17,22 +17,73 @@
#nullable restore
-using Elastic.Clients.Elasticsearch.Fluent;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Elastic.Transport.Products.Elasticsearch;
using System;
-using System.Collections.Generic;
-using System.Text.Json.Serialization;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
-public sealed partial class DeleteAsyncSearchResponse : ElasticsearchResponse
+internal sealed partial class DeleteAsyncSearchResponseConverter : System.Text.Json.Serialization.JsonConverter
{
+ private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged");
+
+ public override Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonValue propAcknowledged = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null))
+ {
+ continue;
+ }
+
+ if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
+ {
+ reader.Skip();
+ continue;
+ }
+
+ throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
+ }
+
+ reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
+ return new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
+ {
+ Acknowledged = propAcknowledged.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null);
+ writer.WriteEndObject();
+ }
+}
+
+[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponseConverter))]
+public sealed partial class DeleteAsyncSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse
+{
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ public DeleteAsyncSearchResponse()
+ {
+ }
+
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ internal DeleteAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
+ {
+ _ = sentinel;
+ }
+
///
///
/// For a successful response, this value is always true. On failure, an exception is returned instead.
///
///
- [JsonInclude, JsonPropertyName("acknowledged")]
- public bool Acknowledged { get; init; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ bool Acknowledged { get; set; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs
index c2884fe1b43..e68424ae83f 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchRequest.g.cs
@@ -17,24 +17,17 @@
#nullable restore
-using Elastic.Clients.Elasticsearch.Fluent;
-using Elastic.Clients.Elasticsearch.Requests;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Elastic.Transport;
-using Elastic.Transport.Extensions;
using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Text.Json;
-using System.Text.Json.Serialization;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
-public sealed partial class GetAsyncSearchRequestParameters : RequestParameters
+public sealed partial class GetAsyncSearchRequestParameters : Elastic.Transport.RequestParameters
{
///
///
- /// Specifies how long the async search should be available in the cluster.
+ /// The length of time that 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.
@@ -60,6 +53,35 @@ public sealed partial class GetAsyncSearchRequestParameters : RequestParameters
public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
}
+internal sealed partial class GetAsyncSearchRequestConverter : System.Text.Json.Serialization.JsonConverter
+{
+ public override Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
+ {
+ reader.Skip();
+ continue;
+ }
+
+ throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
+ }
+
+ reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
+ return new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
+ {
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteEndObject();
+ }
+}
+
///
///
/// Get async search results.
@@ -69,15 +91,27 @@ public sealed partial class GetAsyncSearchRequestParameters : RequestParameters
/// 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
+[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestConverter))]
+public partial class GetAsyncSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest
{
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
{
}
+#if NET7_0_OR_GREATER
+ public GetAsyncSearchRequest()
+ {
+ }
+#endif
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ internal GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
+ {
+ _ = sentinel;
+ }
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;
+ internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.AsyncSearchGet;
- protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+ protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET;
internal override bool SupportsBody => false;
@@ -85,14 +119,24 @@ public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.
///
///
- /// Specifies how long the async search should be available in the cluster.
+ /// A unique identifier for the async search.
+ ///
+ ///
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ Elastic.Clients.Elasticsearch.Id Id { get => P("id"); set => PR("id", value); }
+
+ ///
+ ///
+ /// The length of time that 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.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
///
@@ -100,7 +144,6 @@ public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.
/// 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); }
///
@@ -110,7 +153,6 @@ public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.
/// By default no timeout is set meaning that the currently available results will be returned without any additional wait.
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
}
@@ -123,73 +165,127 @@ public GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.
/// 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>
+public readonly partial struct GetAsyncSearchRequestDescriptor
{
- internal GetAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this);
+ internal Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest Instance { get; init; }
- public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest instance)
{
+ Instance = instance;
}
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;
-
- protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+ public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id)
+ {
+ Instance = new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest(id);
+ }
- internal override bool SupportsBody => false;
+ [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")]
+ public GetAsyncSearchRequestDescriptor()
+ {
+ throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type.");
+ }
- internal override string OperationName => "async_search.get";
+ public static explicit operator Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest instance) => new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor(instance);
+ public static implicit operator Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor descriptor) => descriptor.Instance;
- public GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Duration? keepAlive) => Qs("keep_alive", keepAlive);
- public GetAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
- public GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);
+ ///
+ ///
+ /// A unique identifier for the async search.
+ ///
+ ///
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id value)
+ {
+ Instance.Id = value;
+ return this;
+ }
- public GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
+ ///
+ ///
+ /// The length of time that 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.AsyncSearch.GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Duration? value)
{
- RouteValues.Required("id", id);
- return Self;
+ Instance.KeepAlive = value;
+ return this;
}
- protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ ///
+ ///
+ /// Specify whether aggregation and suggester names should be prefixed by their respective types in the response
+ ///
+ ///
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor TypedKeys(bool? value = true)
{
+ Instance.TypedKeys = value;
+ return this;
}
-}
-///
-///
-/// Get async search results.
-///
-///
-/// Retrieve the results of a previously submitted asynchronous search request.
-/// 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);
+ ///
+ ///
+ /// 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.AsyncSearch.GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Duration? value)
+ {
+ Instance.WaitForCompletionTimeout = value;
+ return this;
+ }
- public GetAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
+ [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
+ internal static Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest Build(System.Action action)
{
+ var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor(new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
+ action.Invoke(builder);
+ return builder.Instance;
}
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchGet;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor ErrorTrace(bool? value)
+ {
+ Instance.ErrorTrace = value;
+ return this;
+ }
- protected override HttpMethod StaticHttpMethod => HttpMethod.GET;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor FilterPath(params string[]? value)
+ {
+ Instance.FilterPath = value;
+ return this;
+ }
- internal override bool SupportsBody => false;
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor Human(bool? value)
+ {
+ Instance.Human = value;
+ return this;
+ }
- internal override string OperationName => "async_search.get";
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor Pretty(bool? value)
+ {
+ Instance.Pretty = value;
+ return this;
+ }
- public GetAsyncSearchRequestDescriptor KeepAlive(Elastic.Clients.Elasticsearch.Duration? keepAlive) => Qs("keep_alive", keepAlive);
- public GetAsyncSearchRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
- public GetAsyncSearchRequestDescriptor WaitForCompletionTimeout(Elastic.Clients.Elasticsearch.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor SourceQueryString(string? value)
+ {
+ Instance.SourceQueryString = value;
+ return this;
+ }
- public GetAsyncSearchRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value)
{
- RouteValues.Required("id", id);
- return Self;
+ Instance.RequestConfiguration = value;
+ return this;
}
- protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
+ public Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor RequestConfiguration(System.Func? configurationSelector)
{
+ Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration;
+ return this;
}
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
index 3dd949e280f..e3713e3ef6e 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs
@@ -17,39 +17,184 @@
#nullable restore
-using Elastic.Clients.Elasticsearch.Fluent;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Elastic.Transport.Products.Elasticsearch;
using System;
-using System.Collections.Generic;
-using System.Text.Json.Serialization;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
-public sealed partial class GetAsyncSearchResponse : ElasticsearchResponse
+internal sealed partial class GetAsyncSearchResponseConverter : System.Text.Json.Serialization.JsonConverter>
{
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTime = System.Text.Json.JsonEncodedText.Encode("completion_time");
+ private static readonly System.Text.Json.JsonEncodedText PropCompletionTimeInMillis = System.Text.Json.JsonEncodedText.Encode("completion_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTime = System.Text.Json.JsonEncodedText.Encode("expiration_time");
+ private static readonly System.Text.Json.JsonEncodedText PropExpirationTimeInMillis = System.Text.Json.JsonEncodedText.Encode("expiration_time_in_millis");
+ private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id");
+ private static readonly System.Text.Json.JsonEncodedText PropIsPartial = System.Text.Json.JsonEncodedText.Encode("is_partial");
+ private static readonly System.Text.Json.JsonEncodedText PropIsRunning = System.Text.Json.JsonEncodedText.Encode("is_running");
+ private static readonly System.Text.Json.JsonEncodedText PropResponse = System.Text.Json.JsonEncodedText.Encode("response");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTime = System.Text.Json.JsonEncodedText.Encode("start_time");
+ private static readonly System.Text.Json.JsonEncodedText PropStartTimeInMillis = System.Text.Json.JsonEncodedText.Encode("start_time_in_millis");
+
+ public override Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonValue propCompletionTime = default;
+ LocalJsonValue propCompletionTimeInMillis = default;
+ LocalJsonValue propExpirationTime = default;
+ LocalJsonValue propExpirationTimeInMillis = default;
+ LocalJsonValue propId = default;
+ LocalJsonValue propIsPartial = default;
+ LocalJsonValue propIsRunning = default;
+ LocalJsonValue> propResponse = default;
+ LocalJsonValue propStartTime = default;
+ LocalJsonValue propStartTimeInMillis = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propCompletionTime.TryReadProperty(ref reader, options, PropCompletionTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))))
+ {
+ continue;
+ }
+
+ if (propCompletionTimeInMillis.TryReadProperty(ref reader, options, PropCompletionTimeInMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))))
+ {
+ continue;
+ }
+
+ if (propExpirationTime.TryReadProperty(ref reader, options, PropExpirationTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))))
+ {
+ continue;
+ }
+
+ if (propExpirationTimeInMillis.TryReadProperty(ref reader, options, PropExpirationTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))))
+ {
+ continue;
+ }
+
+ if (propId.TryReadProperty(ref reader, options, PropId, null))
+ {
+ continue;
+ }
+
+ if (propIsPartial.TryReadProperty(ref reader, options, PropIsPartial, null))
+ {
+ continue;
+ }
+
+ if (propIsRunning.TryReadProperty(ref reader, options, PropIsRunning, null))
+ {
+ continue;
+ }
+
+ if (propResponse.TryReadProperty(ref reader, options, PropResponse, null))
+ {
+ continue;
+ }
+
+ if (propStartTime.TryReadProperty(ref reader, options, PropStartTime, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))))
+ {
+ continue;
+ }
+
+ if (propStartTimeInMillis.TryReadProperty(ref reader, options, PropStartTimeInMillis, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))))
+ {
+ continue;
+ }
+
+ if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
+ {
+ reader.Skip();
+ continue;
+ }
+
+ throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
+ }
+
+ reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
+ return new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
+ {
+ CompletionTime = propCompletionTime.Value,
+ CompletionTimeInMillis = propCompletionTimeInMillis.Value,
+ ExpirationTime = propExpirationTime.Value,
+ ExpirationTimeInMillis = propExpirationTimeInMillis.Value,
+ Id = propId.Value,
+ IsPartial = propIsPartial.Value,
+ IsRunning = propIsRunning.Value,
+ Response = propResponse.Value,
+ StartTime = propStartTime.Value,
+ StartTimeInMillis = propStartTimeInMillis.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropCompletionTime, value.CompletionTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)));
+ writer.WriteProperty(options, PropCompletionTimeInMillis, value.CompletionTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)));
+ writer.WriteProperty(options, PropExpirationTime, value.ExpirationTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)));
+ writer.WriteProperty(options, PropExpirationTimeInMillis, value.ExpirationTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)));
+ writer.WriteProperty(options, PropId, value.Id, null, null);
+ writer.WriteProperty(options, PropIsPartial, value.IsPartial, null, null);
+ writer.WriteProperty(options, PropIsRunning, value.IsRunning, null, null);
+ writer.WriteProperty(options, PropResponse, value.Response, null, null);
+ writer.WriteProperty(options, PropStartTime, value.StartTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)));
+ writer.WriteProperty(options, PropStartTimeInMillis, value.StartTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)));
+ writer.WriteEndObject();
+ }
+}
+
+internal sealed partial class GetAsyncSearchResponseConverterFactory : System.Text.Json.Serialization.JsonConverterFactory
+{
+ public override bool CanConvert(System.Type typeToConvert)
+ {
+ return typeToConvert.IsGenericType && typeToConvert.GetGenericTypeDefinition() == typeof(GetAsyncSearchResponse<>);
+ }
+
+ public override System.Text.Json.Serialization.JsonConverter CreateConverter(System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ var args = typeToConvert.GetGenericArguments();
+#pragma warning disable IL3050
+ var converter = (System.Text.Json.Serialization.JsonConverter)System.Activator.CreateInstance(typeof(GetAsyncSearchResponseConverter<>).MakeGenericType(args[0]), System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, binder: null, args: null, culture: null)!;
+#pragma warning restore IL3050
+ return converter;
+ }
+}
+
+[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponseConverterFactory))]
+public sealed partial class GetAsyncSearchResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse
+{
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ public GetAsyncSearchResponse()
+ {
+ }
+
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ internal GetAsyncSearchResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
+ {
+ _ = sentinel;
+ }
+
///
///
- /// Indicates when the async search completed. Only present
- /// when the search has completed.
+ /// Indicates when the async search completed.
+ /// It is present only when the search has completed.
///
///
- [JsonInclude, JsonPropertyName("completion_time")]
- public DateTimeOffset? CompletionTime { get; init; }
- [JsonInclude, JsonPropertyName("completion_time_in_millis")]
- public long? CompletionTimeInMillis { get; init; }
+ public System.DateTimeOffset? CompletionTime { get; set; }
+ public System.DateTimeOffset? CompletionTimeInMillis { get; set; }
///
///
/// Indicates when the async search will expire.
///
///
- [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; }
+ public System.DateTimeOffset? ExpirationTime { get; set; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ System.DateTimeOffset ExpirationTimeInMillis { get; set; }
+ public string? Id { get; set; }
///
///
@@ -57,21 +202,35 @@ public sealed partial class GetAsyncSearchResponse : ElasticsearchRes
/// While the query is running, is_partial is always set to true.
///
///
- [JsonInclude, JsonPropertyName("is_partial")]
- public bool IsPartial { get; init; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ bool IsPartial { get; set; }
///
///
/// Indicates whether the search is still running or has completed.
- /// NOTE: If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.
+ ///
+ ///
+ /// info
+ /// If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.
///
///
- [JsonInclude, JsonPropertyName("is_running")]
- public bool IsRunning { get; init; }
- [JsonInclude, JsonPropertyName("response")]
- public Elastic.Clients.Elasticsearch.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; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ bool IsRunning { get; set; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearch Response { get; set; }
+ public System.DateTimeOffset? StartTime { get; set; }
+ public
+#if NET7_0_OR_GREATER
+ required
+#endif
+ System.DateTimeOffset StartTimeInMillis { get; set; }
}
\ No newline at end of file
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
index d44016dcd11..983f2108868 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchRequest.g.cs
@@ -17,20 +17,13 @@
#nullable restore
-using Elastic.Clients.Elasticsearch.Fluent;
-using Elastic.Clients.Elasticsearch.Requests;
-using Elastic.Clients.Elasticsearch.Serialization;
-using Elastic.Transport;
-using Elastic.Transport.Extensions;
using System;
-using System.Collections.Generic;
-using System.Linq.Expressions;
-using System.Text.Json;
-using System.Text.Json.Serialization;
+using System.Linq;
+using Elastic.Clients.Elasticsearch.Serialization;
namespace Elastic.Clients.Elasticsearch.AsyncSearch;
-public sealed partial class SubmitAsyncSearchRequestParameters : RequestParameters
+public sealed partial class SubmitAsyncSearchRequestParameters : Elastic.Transport.RequestParameters
{
///
///
@@ -94,7 +87,7 @@ public sealed partial class SubmitAsyncSearchRequestParameters : RequestParamete
/// 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); }
+ public System.Collections.Generic.ICollection? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); }
///
///
@@ -137,8 +130,7 @@ public sealed partial class SubmitAsyncSearchRequestParameters : RequestParamete
/// 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); }
+ public int? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", value); }
///
///
@@ -240,410 +232,321 @@ public sealed partial class SubmitAsyncSearchRequestParameters : RequestParamete
public Elastic.Clients.Elasticsearch.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
}
-internal sealed partial class SubmitAsyncSearchRequestConverter : JsonConverter
+internal sealed partial class SubmitAsyncSearchRequestConverter : System.Text.Json.Serialization.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)
+ private static readonly System.Text.Json.JsonEncodedText PropAggregations = System.Text.Json.JsonEncodedText.Encode("aggregations");
+ private static readonly System.Text.Json.JsonEncodedText PropAggregations1 = System.Text.Json.JsonEncodedText.Encode("aggs");
+ private static readonly System.Text.Json.JsonEncodedText PropCollapse = System.Text.Json.JsonEncodedText.Encode("collapse");
+ private static readonly System.Text.Json.JsonEncodedText PropDocvalueFields = System.Text.Json.JsonEncodedText.Encode("docvalue_fields");
+ private static readonly System.Text.Json.JsonEncodedText PropExplain = System.Text.Json.JsonEncodedText.Encode("explain");
+ private static readonly System.Text.Json.JsonEncodedText PropExt = System.Text.Json.JsonEncodedText.Encode("ext");
+ private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields");
+ private static readonly System.Text.Json.JsonEncodedText PropFrom = System.Text.Json.JsonEncodedText.Encode("from");
+ private static readonly System.Text.Json.JsonEncodedText PropHighlight = System.Text.Json.JsonEncodedText.Encode("highlight");
+ private static readonly System.Text.Json.JsonEncodedText PropIndicesBoost = System.Text.Json.JsonEncodedText.Encode("indices_boost");
+ private static readonly System.Text.Json.JsonEncodedText PropKnn = System.Text.Json.JsonEncodedText.Encode("knn");
+ private static readonly System.Text.Json.JsonEncodedText PropMinScore = System.Text.Json.JsonEncodedText.Encode("min_score");
+ private static readonly System.Text.Json.JsonEncodedText PropPit = System.Text.Json.JsonEncodedText.Encode("pit");
+ private static readonly System.Text.Json.JsonEncodedText PropPostFilter = System.Text.Json.JsonEncodedText.Encode("post_filter");
+ private static readonly System.Text.Json.JsonEncodedText PropProfile = System.Text.Json.JsonEncodedText.Encode("profile");
+ private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query");
+ private static readonly System.Text.Json.JsonEncodedText PropRescore = System.Text.Json.JsonEncodedText.Encode("rescore");
+ private static readonly System.Text.Json.JsonEncodedText PropRuntimeMappings = System.Text.Json.JsonEncodedText.Encode("runtime_mappings");
+ private static readonly System.Text.Json.JsonEncodedText PropScriptFields = System.Text.Json.JsonEncodedText.Encode("script_fields");
+ private static readonly System.Text.Json.JsonEncodedText PropSearchAfter = System.Text.Json.JsonEncodedText.Encode("search_after");
+ private static readonly System.Text.Json.JsonEncodedText PropSeqNoPrimaryTerm = System.Text.Json.JsonEncodedText.Encode("seq_no_primary_term");
+ private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size");
+ private static readonly System.Text.Json.JsonEncodedText PropSlice = System.Text.Json.JsonEncodedText.Encode("slice");
+ private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort");
+ private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source");
+ private static readonly System.Text.Json.JsonEncodedText PropStats = System.Text.Json.JsonEncodedText.Encode("stats");
+ private static readonly System.Text.Json.JsonEncodedText PropStoredFields = System.Text.Json.JsonEncodedText.Encode("stored_fields");
+ private static readonly System.Text.Json.JsonEncodedText PropSuggest = System.Text.Json.JsonEncodedText.Encode("suggest");
+ private static readonly System.Text.Json.JsonEncodedText PropTerminateAfter = System.Text.Json.JsonEncodedText.Encode("terminate_after");
+ private static readonly System.Text.Json.JsonEncodedText PropTimeout = System.Text.Json.JsonEncodedText.Encode("timeout");
+ private static readonly System.Text.Json.JsonEncodedText PropTrackScores = System.Text.Json.JsonEncodedText.Encode("track_scores");
+ private static readonly System.Text.Json.JsonEncodedText PropTrackTotalHits = System.Text.Json.JsonEncodedText.Encode("track_total_hits");
+ private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version");
+
+ public override Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options)
+ {
+ reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject);
+ LocalJsonValue?> propAggregations = default;
+ LocalJsonValue propCollapse = default;
+ LocalJsonValue?> propDocvalueFields = default;
+ LocalJsonValue propExplain = default;
+ LocalJsonValue?> propExt = default;
+ LocalJsonValue?> propFields = default;
+ LocalJsonValue propFrom = default;
+ LocalJsonValue propHighlight = default;
+ LocalJsonValue>?> propIndicesBoost = default;
+ LocalJsonValue?> propKnn = default;
+ LocalJsonValue propMinScore = default;
+ LocalJsonValue propPit = default;
+ LocalJsonValue propPostFilter = default;
+ LocalJsonValue propProfile = default;
+ LocalJsonValue propQuery = default;
+ LocalJsonValue?> propRescore = default;
+ LocalJsonValue?> propRuntimeMappings = default;
+ LocalJsonValue?> propScriptFields = default;
+ LocalJsonValue?> propSearchAfter = default;
+ LocalJsonValue propSeqNoPrimaryTerm = default;
+ LocalJsonValue propSize = default;
+ LocalJsonValue propSlice = default;
+ LocalJsonValue?> propSort = default;
+ LocalJsonValue propSource = default;
+ LocalJsonValue?> propStats = default;
+ LocalJsonValue propStoredFields = default;
+ LocalJsonValue propSuggest = default;
+ LocalJsonValue propTerminateAfter = default;
+ LocalJsonValue propTimeout = default;
+ LocalJsonValue propTrackScores = default;
+ LocalJsonValue propTrackTotalHits = default;
+ LocalJsonValue propVersion = default;
+ while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName)
+ {
+ if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)) || propAggregations.TryReadProperty(ref reader, options, PropAggregations1, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)))
{
- 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 == "docvalue_fields")
- {
- variant.DocvalueFields = 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 == "fields")
- {
- variant.Fields = 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 == "indices_boost")
- {
- variant.IndicesBoost = 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 == "pit")
- {
- variant.Pit = 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 == "runtime_mappings")
- {
- variant.RuntimeMappings = 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 == "seq_no_primary_term")
- {
- variant.SeqNoPrimaryTerm = 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 == "stats")
- {
- variant.Stats = JsonSerializer.Deserialize?>(ref reader, options);
- continue;
- }
-
- if (property == "stored_fields")
- {
- variant.StoredFields = 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 == "track_total_hits")
- {
- variant.TrackTotalHits = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
-
- if (property == "version")
- {
- variant.Version = JsonSerializer.Deserialize(ref reader, options);
- continue;
- }
+ 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 (propCollapse.TryReadProperty(ref reader, options, PropCollapse, null))
+ {
+ continue;
+ }
- if (value.Collapse is not null)
- {
- writer.WritePropertyName("collapse");
- JsonSerializer.Serialize(writer, value.Collapse, options);
- }
+ if (propDocvalueFields.TryReadProperty(ref reader, options, PropDocvalueFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)))
+ {
+ continue;
+ }
- if (value.DocvalueFields is not null)
- {
- writer.WritePropertyName("docvalue_fields");
- JsonSerializer.Serialize(writer, value.DocvalueFields, options);
- }
+ if (propExplain.TryReadProperty(ref reader, options, PropExplain, null))
+ {
+ continue;
+ }
- if (value.Explain.HasValue)
- {
- writer.WritePropertyName("explain");
- writer.WriteBooleanValue(value.Explain.Value);
- }
+ if (propExt.TryReadProperty(ref reader, options, PropExt, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)))
+ {
+ continue;
+ }
- if (value.Ext is not null)
- {
- writer.WritePropertyName("ext");
- JsonSerializer.Serialize(writer, value.Ext, options);
- }
+ if (propFields.TryReadProperty(ref reader, options, PropFields, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)))
+ {
+ continue;
+ }
- if (value.Fields is not null)
- {
- writer.WritePropertyName("fields");
- JsonSerializer.Serialize(writer, value.Fields, options);
- }
+ if (propFrom.TryReadProperty(ref reader, options, PropFrom, null))
+ {
+ continue;
+ }
- if (value.From.HasValue)
- {
- writer.WritePropertyName("from");
- writer.WriteNumberValue(value.From.Value);
- }
+ if (propHighlight.TryReadProperty(ref reader, options, PropHighlight, null))
+ {
+ continue;
+ }
- if (value.Highlight is not null)
- {
- writer.WritePropertyName("highlight");
- JsonSerializer.Serialize(writer, value.Highlight, options);
- }
+ if (propIndicesBoost.TryReadProperty(ref reader, options, PropIndicesBoost, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, null))))
+ {
+ continue;
+ }
- if (value.IndicesBoost is not null)
- {
- writer.WritePropertyName("indices_boost");
- JsonSerializer.Serialize(writer, value.IndicesBoost, options);
- }
+ if (propKnn.TryReadProperty(ref reader, options, PropKnn, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)))
+ {
+ continue;
+ }
- if (value.Knn is not null)
- {
- writer.WritePropertyName("knn");
- JsonSerializer.Serialize(writer, value.Knn, options);
- }
+ if (propMinScore.TryReadProperty(ref reader, options, PropMinScore, null))
+ {
+ continue;
+ }
- if (value.MinScore.HasValue)
- {
- writer.WritePropertyName("min_score");
- writer.WriteNumberValue(value.MinScore.Value);
- }
+ if (propPit.TryReadProperty(ref reader, options, PropPit, null))
+ {
+ continue;
+ }
- if (value.Pit is not null)
- {
- writer.WritePropertyName("pit");
- JsonSerializer.Serialize(writer, value.Pit, options);
- }
+ if (propPostFilter.TryReadProperty(ref reader, options, PropPostFilter, null))
+ {
+ continue;
+ }
- if (value.PostFilter is not null)
- {
- writer.WritePropertyName("post_filter");
- JsonSerializer.Serialize(writer, value.PostFilter, options);
- }
+ if (propProfile.TryReadProperty(ref reader, options, PropProfile, null))
+ {
+ continue;
+ }
- if (value.Profile.HasValue)
- {
- writer.WritePropertyName("profile");
- writer.WriteBooleanValue(value.Profile.Value);
- }
+ if (propQuery.TryReadProperty(ref reader, options, PropQuery, null))
+ {
+ continue;
+ }
- if (value.Query is not null)
- {
- writer.WritePropertyName("query");
- JsonSerializer.Serialize(writer, value.Query, options);
- }
+ if (propRescore.TryReadProperty(ref reader, options, PropRescore, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)))
+ {
+ continue;
+ }
- if (value.Rescore is not null)
- {
- writer.WritePropertyName("rescore");
- JsonSerializer.Serialize(writer, value.Rescore, options);
- }
+ if (propRuntimeMappings.TryReadProperty(ref reader, options, PropRuntimeMappings, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)))
+ {
+ continue;
+ }
- if (value.RuntimeMappings is not null)
- {
- writer.WritePropertyName("runtime_mappings");
- JsonSerializer.Serialize(writer, value.RuntimeMappings, options);
- }
+ if (propScriptFields.TryReadProperty(ref reader, options, PropScriptFields, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)))
+ {
+ continue;
+ }
- if (value.ScriptFields is not null)
- {
- writer.WritePropertyName("script_fields");
- JsonSerializer.Serialize(writer, value.ScriptFields, options);
- }
+ if (propSearchAfter.TryReadProperty(ref reader, options, PropSearchAfter, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)))
+ {
+ continue;
+ }
- if (value.SearchAfter is not null)
- {
- writer.WritePropertyName("search_after");
- JsonSerializer.Serialize(writer, value.SearchAfter, options);
- }
+ if (propSeqNoPrimaryTerm.TryReadProperty(ref reader, options, PropSeqNoPrimaryTerm, null))
+ {
+ continue;
+ }
- if (value.SeqNoPrimaryTerm.HasValue)
- {
- writer.WritePropertyName("seq_no_primary_term");
- writer.WriteBooleanValue(value.SeqNoPrimaryTerm.Value);
- }
+ if (propSize.TryReadProperty(ref reader, options, PropSize, null))
+ {
+ continue;
+ }
- if (value.Size.HasValue)
- {
- writer.WritePropertyName("size");
- writer.WriteNumberValue(value.Size.Value);
- }
+ if (propSlice.TryReadProperty(ref reader, options, PropSlice, null))
+ {
+ continue;
+ }
- if (value.Slice is not null)
- {
- writer.WritePropertyName("slice");
- JsonSerializer.Serialize(writer, value.Slice, options);
- }
+ if (propSort.TryReadProperty(ref reader, options, PropSort, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)))
+ {
+ continue;
+ }
- if (value.Sort is not null)
- {
- writer.WritePropertyName("sort");
- JsonSerializer.Serialize(writer, value.Sort, options);
- }
+ if (propSource.TryReadProperty(ref reader, options, PropSource, null))
+ {
+ continue;
+ }
- if (value.Source is not null)
- {
- writer.WritePropertyName("_source");
- JsonSerializer.Serialize(writer, value.Source, options);
- }
+ if (propStats.TryReadProperty(ref reader, options, PropStats, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)))
+ {
+ continue;
+ }
- if (value.Stats is not null)
- {
- writer.WritePropertyName("stats");
- JsonSerializer.Serialize(writer, value.Stats, options);
- }
+ if (propStoredFields.TryReadProperty(ref reader, options, PropStoredFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))))
+ {
+ continue;
+ }
- if (value.StoredFields is not null)
- {
- writer.WritePropertyName("stored_fields");
- new FieldsConverter().Write(writer, value.StoredFields, options);
- }
+ if (propSuggest.TryReadProperty(ref reader, options, PropSuggest, null))
+ {
+ continue;
+ }
- if (value.Suggest is not null)
- {
- writer.WritePropertyName("suggest");
- JsonSerializer.Serialize(writer, value.Suggest, options);
- }
+ if (propTerminateAfter.TryReadProperty(ref reader, options, PropTerminateAfter, null))
+ {
+ continue;
+ }
- if (value.TerminateAfter.HasValue)
- {
- writer.WritePropertyName("terminate_after");
- writer.WriteNumberValue(value.TerminateAfter.Value);
- }
+ if (propTimeout.TryReadProperty(ref reader, options, PropTimeout, null))
+ {
+ continue;
+ }
- if (!string.IsNullOrEmpty(value.Timeout))
- {
- writer.WritePropertyName("timeout");
- writer.WriteStringValue(value.Timeout);
- }
+ if (propTrackScores.TryReadProperty(ref reader, options, PropTrackScores, null))
+ {
+ continue;
+ }
- if (value.TrackScores.HasValue)
- {
- writer.WritePropertyName("track_scores");
- writer.WriteBooleanValue(value.TrackScores.Value);
- }
+ if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null))
+ {
+ continue;
+ }
- if (value.TrackTotalHits is not null)
- {
- writer.WritePropertyName("track_total_hits");
- JsonSerializer.Serialize(writer, value.TrackTotalHits, options);
- }
+ if (propVersion.TryReadProperty(ref reader, options, PropVersion, null))
+ {
+ continue;
+ }
- if (value.Version.HasValue)
- {
- writer.WritePropertyName("version");
- writer.WriteBooleanValue(value.Version.Value);
- }
+ if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip)
+ {
+ reader.Skip();
+ continue;
+ }
+ throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'.");
+ }
+
+ reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject);
+ return new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)
+ {
+ Aggregations = propAggregations.Value,
+ Collapse = propCollapse.Value,
+ DocvalueFields = propDocvalueFields.Value,
+ Explain = propExplain.Value,
+ Ext = propExt.Value,
+ Fields = propFields.Value,
+ From = propFrom.Value,
+ Highlight = propHighlight.Value,
+ IndicesBoost = propIndicesBoost.Value,
+ Knn = propKnn.Value,
+ MinScore = propMinScore.Value,
+ Pit = propPit.Value,
+ PostFilter = propPostFilter.Value,
+ Profile = propProfile.Value,
+ Query = propQuery.Value,
+ Rescore = propRescore.Value,
+ RuntimeMappings = propRuntimeMappings.Value,
+ ScriptFields = propScriptFields.Value,
+ SearchAfter = propSearchAfter.Value,
+ SeqNoPrimaryTerm = propSeqNoPrimaryTerm.Value,
+ Size = propSize.Value,
+ Slice = propSlice.Value,
+ Sort = propSort.Value,
+ Source = propSource.Value,
+ Stats = propStats.Value,
+ StoredFields = propStoredFields.Value,
+ Suggest = propSuggest.Value,
+ TerminateAfter = propTerminateAfter.Value,
+ Timeout = propTimeout.Value,
+ TrackScores = propTrackScores.Value,
+ TrackTotalHits = propTrackTotalHits.Value,
+ Version = propVersion.Value
+ };
+ }
+
+ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest value, System.Text.Json.JsonSerializerOptions options)
+ {
+ writer.WriteStartObject();
+ writer.WriteProperty(options, PropAggregations, value.Aggregations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null));
+ writer.WriteProperty(options, PropCollapse, value.Collapse, null, null);
+ writer.WriteProperty(options, PropDocvalueFields, value.DocvalueFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null));
+ writer.WriteProperty(options, PropExplain, value.Explain, null, null);
+ writer.WriteProperty(options, PropExt, value.Ext, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null));
+ writer.WriteProperty(options, PropFields, value.Fields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null));
+ writer.WriteProperty(options, PropFrom, value.From, null, null);
+ writer.WriteProperty(options, PropHighlight, value.Highlight, null, null);
+ writer.WriteProperty(options, PropIndicesBoost, value.IndicesBoost, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)));
+ writer.WriteProperty(options, PropKnn, value.Knn, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null));
+ writer.WriteProperty(options, PropMinScore, value.MinScore, null, null);
+ writer.WriteProperty(options, PropPit, value.Pit, null, null);
+ writer.WriteProperty(options, PropPostFilter, value.PostFilter, null, null);
+ writer.WriteProperty(options, PropProfile, value.Profile, null, null);
+ writer.WriteProperty(options, PropQuery, value.Query, null, null);
+ writer.WriteProperty(options, PropRescore, value.Rescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null));
+ writer.WriteProperty(options, PropRuntimeMappings, value.RuntimeMappings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null));
+ writer.WriteProperty(options, PropScriptFields, value.ScriptFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null));
+ writer.WriteProperty(options, PropSearchAfter, value.SearchAfter, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null));
+ writer.WriteProperty(options, PropSeqNoPrimaryTerm, value.SeqNoPrimaryTerm, null, null);
+ writer.WriteProperty(options, PropSize, value.Size, null, null);
+ writer.WriteProperty(options, PropSlice, value.Slice, null, null);
+ writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null));
+ writer.WriteProperty(options, PropSource, value.Source, null, null);
+ writer.WriteProperty(options, PropStats, value.Stats, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null));
+ writer.WriteProperty(options, PropStoredFields, value.StoredFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)));
+ writer.WriteProperty(options, PropSuggest, value.Suggest, null, null);
+ writer.WriteProperty(options, PropTerminateAfter, value.TerminateAfter, null, null);
+ writer.WriteProperty(options, PropTimeout, value.Timeout, null, null);
+ writer.WriteProperty(options, PropTrackScores, value.TrackScores, null, null);
+ writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null);
+ writer.WriteProperty(options, PropVersion, value.Version, null, null);
writer.WriteEndObject();
}
}
@@ -663,31 +566,48 @@ public override void Write(Utf8JsonWriter writer, SubmitAsyncSearchRequest value
/// 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.
///
///
-[JsonConverter(typeof(SubmitAsyncSearchRequestConverter))]
-public sealed partial class SubmitAsyncSearchRequest : PlainRequest
+[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestConverter))]
+public partial class SubmitAsyncSearchRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest
{
+ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
+ {
+ }
+#if NET7_0_OR_GREATER
public SubmitAsyncSearchRequest()
{
}
-
- public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
+#endif
+#if !NET7_0_OR_GREATER
+ public SubmitAsyncSearchRequest()
+ {
+ }
+#endif
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ internal SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
{
+ _ = sentinel;
}
- internal override ApiUrls ApiUrls => ApiUrlLookup.AsyncSearchSubmit;
+ internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.AsyncSearchSubmit;
- protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
+ protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.POST;
internal override bool SupportsBody => true;
internal override string OperationName => "async_search.submit";
+ ///
+ ///
+ /// A comma-separated list of index names to search; use _all or empty string to perform the operation on all indices
+ ///
+ ///
+ public Elastic.Clients.Elasticsearch.Indices? Indices { get => P("index"); set => PO("index", 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); }
///
@@ -695,7 +615,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -703,7 +622,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// The analyzer to use for the query string
///
///
- [JsonIgnore]
public string? Analyzer { get => Q("analyzer"); set => Q("analyzer", value); }
///
@@ -711,7 +629,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Specify whether wildcard and prefix queries should be analyzed (default: false)
///
///
- [JsonIgnore]
public bool? AnalyzeWildcard { get => Q("analyze_wildcard"); set => Q("analyze_wildcard", value); }
///
@@ -720,7 +637,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -728,7 +644,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// The default value is the only supported value.
///
///
- [JsonIgnore]
public bool? CcsMinimizeRoundtrips { get => Q("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
///
@@ -736,7 +651,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// The default operator for query string query (AND or OR)
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); }
///
@@ -744,7 +658,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -752,15 +665,13 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
+ public System.Collections.Generic.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); }
///
@@ -768,7 +679,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -777,7 +687,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Ongoing async searches and any saved search results are deleted after this period.
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Duration? KeepAlive { get => Q("keep_alive"); set => Q("keep_alive", value); }
///
@@ -785,7 +694,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -793,7 +701,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -801,17 +708,13 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
+ public int? MaxConcurrentShardRequests { get => Q("max_concurrent_shard_requests"); set => Q("max_concurrent_shard_requests", 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); }
///
@@ -819,7 +722,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Query in the Lucene query string syntax
///
///
- [JsonIgnore]
public string? QueryLuceneSyntax { get => Q("q"); set => Q("q", value); }
///
@@ -827,7 +729,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -835,7 +736,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Indicates whether hits.total should be rendered as an integer or an object in the rest search response
///
///
- [JsonIgnore]
public bool? RestTotalHitsAsInt { get => Q("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
///
@@ -843,7 +743,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// A comma-separated list of specific routing values
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Routing? Routing { get => Q("routing"); set => Q("routing", value); }
///
@@ -851,7 +750,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Search operation type
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.SearchType? SearchType { get => Q("search_type"); set => Q("search_type", value); }
///
@@ -859,7 +757,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// A list of fields to exclude from the returned _source field
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Fields? SourceExcludes { get => Q("_source_excludes"); set => Q("_source_excludes", value); }
///
@@ -867,7 +764,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// A list of fields to extract and return from the _source field
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Fields? SourceIncludes { get => Q("_source_includes"); set => Q("_source_includes", value); }
///
@@ -875,7 +771,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Specifies which field to use for suggestions.
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.Field? SuggestField { get => Q("suggest_field"); set => Q("suggest_field", value); }
///
@@ -883,7 +778,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Specify suggest mode
///
///
- [JsonIgnore]
public Elastic.Clients.Elasticsearch.SuggestMode? SuggestMode { get => Q("suggest_mode"); set => Q("suggest_mode", value); }
///
@@ -891,7 +785,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// How many suggestions to return in response
///
///
- [JsonIgnore]
public long? SuggestSize { get => Q("suggest_size"); set => Q("suggest_size", value); }
///
@@ -899,7 +792,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// The source text for which the suggestions should be returned.
///
///
- [JsonIgnore]
public string? SuggestText { get => Q("suggest_text"); set => Q("suggest_text", value); }
///
@@ -907,7 +799,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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); }
///
@@ -916,11 +807,8 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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.Duration? WaitForCompletionTimeout { get => Q("wait_for_completion_timeout"); set => Q("wait_for_completion_timeout", value); }
- [JsonInclude, JsonPropertyName("aggregations")]
- public IDictionary? Aggregations { get; set; }
- [JsonInclude, JsonPropertyName("collapse")]
+ public System.Collections.Generic.IDictionary? Aggregations { get; set; }
public Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? Collapse { get; set; }
///
@@ -929,15 +817,13 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// names matching these patterns in the hits.fields property of the response.
///
///
- [JsonInclude, JsonPropertyName("docvalue_fields")]
- public ICollection? DocvalueFields { get; set; }
+ public System.Collections.Generic.ICollection? DocvalueFields { get; set; }
///
///
/// If true, returns detailed information about score computation as part of a hit.
///
///
- [JsonInclude, JsonPropertyName("explain")]
public bool? Explain { get; set; }
///
@@ -945,8 +831,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Configuration of search extensions defined by Elasticsearch plugins.
///
///
- [JsonInclude, JsonPropertyName("ext")]
- public IDictionary? Ext { get; set; }
+ public System.Collections.Generic.IDictionary? Ext { get; set; }
///
///
@@ -954,8 +839,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// matching these patterns in the hits.fields property of the response.
///
///
- [JsonInclude, JsonPropertyName("fields")]
- public ICollection? Fields { get; set; }
+ public System.Collections.Generic.ICollection? Fields { get; set; }
///
///
@@ -964,9 +848,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// search_after parameter.
///
///
- [JsonInclude, JsonPropertyName("from")]
public int? From { get; set; }
- [JsonInclude, JsonPropertyName("highlight")]
public Elastic.Clients.Elasticsearch.Core.Search.Highlight? Highlight { get; set; }
///
@@ -974,25 +856,21 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Boosts the _score of documents from specified indices.
///
///
- [JsonInclude, JsonPropertyName("indices_boost")]
- public ICollection>? IndicesBoost { get; set; }
+ public System.Collections.Generic.ICollection>? IndicesBoost { get; set; }
///
///
/// Defines the approximate kNN search to run.
///
///
- [JsonInclude, JsonPropertyName("knn")]
- [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.KnnSearch))]
- public ICollection? Knn { get; set; }
+ public System.Collections.Generic.ICollection? Knn { get; set; }
///
///
/// Minimum _score for matching documents. Documents with a lower _score are
- /// not included in the search results.
+ /// not included in search results and results collected by aggregations.
///
///
- [JsonInclude, JsonPropertyName("min_score")]
public double? MinScore { get; set; }
///
@@ -1001,11 +879,8 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// cannot specify an <index> in the request path.
///
///
- [JsonInclude, JsonPropertyName("pit")]
public Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? Pit { get; set; }
- [JsonInclude, JsonPropertyName("post_filter")]
public Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilter { get; set; }
- [JsonInclude, JsonPropertyName("profile")]
public bool? Profile { get; set; }
///
@@ -1013,11 +888,8 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Defines the search definition using the Query DSL.
///
///
- [JsonInclude, JsonPropertyName("query")]
public Elastic.Clients.Elasticsearch.QueryDsl.Query? Query { get; set; }
- [JsonInclude, JsonPropertyName("rescore")]
- [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.Core.Search.Rescore))]
- public ICollection? Rescore { get; set; }
+ public System.Collections.Generic.ICollection? Rescore { get; set; }
///
///
@@ -1025,18 +897,15 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// precedence over mapped fields with the same name.
///
///
- [JsonInclude, JsonPropertyName("runtime_mappings")]
- public IDictionary? RuntimeMappings { get; set; }
+ public System.Collections.Generic.IDictionary? RuntimeMappings { 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; }
+ public System.Collections.Generic.IDictionary? ScriptFields { get; set; }
+ public System.Collections.Generic.ICollection? SearchAfter { get; set; }
///
///
@@ -1044,7 +913,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// of each hit. See Optimistic concurrency control.
///
///
- [JsonInclude, JsonPropertyName("seq_no_primary_term")]
public bool? SeqNoPrimaryTerm { get; set; }
///
@@ -1054,13 +922,9 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// hits, use the search_after parameter.
///
///
- [JsonInclude, JsonPropertyName("size")]
public int? Size { get; set; }
- [JsonInclude, JsonPropertyName("slice")]
public Elastic.Clients.Elasticsearch.SlicedScroll? Slice { get; set; }
- [JsonInclude, JsonPropertyName("sort")]
- [SingleOrManyCollectionConverter(typeof(Elastic.Clients.Elasticsearch.SortOptions))]
- public ICollection? Sort { get; set; }
+ public System.Collections.Generic.ICollection? Sort { get; set; }
///
///
@@ -1068,7 +932,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// fields are returned in the hits._source property of the search response.
///
///
- [JsonInclude, JsonPropertyName("_source")]
public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; }
///
@@ -1078,8 +941,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// the indices stats API.
///
///
- [JsonInclude, JsonPropertyName("stats")]
- public ICollection? Stats { get; set; }
+ public System.Collections.Generic.ICollection? Stats { get; set; }
///
///
@@ -1089,10 +951,7 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// and stored fields in the search response.
///
///
- [JsonInclude, JsonPropertyName("stored_fields")]
- [JsonConverter(typeof(SingleOrManyFieldsConverter))]
public Elastic.Clients.Elasticsearch.Fields? StoredFields { get; set; }
- [JsonInclude, JsonPropertyName("suggest")]
public Elastic.Clients.Elasticsearch.Core.Search.Suggester? Suggest { get; set; }
///
@@ -1102,7 +961,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// before sorting. Defaults to 0, which does not terminate query execution early.
///
///
- [JsonInclude, JsonPropertyName("terminate_after")]
public long? TerminateAfter { get; set; }
///
@@ -1112,7 +970,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Defaults to no timeout.
///
///
- [JsonInclude, JsonPropertyName("timeout")]
public string? Timeout { get; set; }
///
@@ -1120,7 +977,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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; }
///
@@ -1131,7 +987,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// Defaults to 10,000 hits.
///
///
- [JsonInclude, JsonPropertyName("track_total_hits")]
public Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHits { get; set; }
///
@@ -1139,7 +994,6 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// If true, returns document version as part of a hit.
///
///
- [JsonInclude, JsonPropertyName("version")]
public bool? Version { get; set; }
}
@@ -1158,1276 +1012,1839 @@ public SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Indices? indices)
/// 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>
+public readonly partial struct SubmitAsyncSearchRequestDescriptor
{
- internal SubmitAsyncSearchRequestDescriptor(Action> configure) => configure.Invoke(this);
+ internal Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest Instance { get; init; }
- public SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => r.Optional("index", indices))
+ [System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
+ public SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest instance)
{
+ Instance = instance;
}
- public SubmitAsyncSearchRequestDescriptor()
+ public SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.Indices? indices)
{
+ Instance = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest(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";
-
- 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 Analyzer(string? analyzer) => Qs("analyzer", analyzer);
- public SubmitAsyncSearchRequestDescriptor AnalyzeWildcard(bool? analyzeWildcard = true) => Qs("analyze_wildcard", analyzeWildcard);
- 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.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.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 Preference(string? preference) => Qs("preference", preference);
- public SubmitAsyncSearchRequestDescriptor QueryLuceneSyntax(string? queryLuceneSyntax) => Qs("q", queryLuceneSyntax);
- 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.Routing? routing) => Qs("routing", routing);
- public SubmitAsyncSearchRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.SearchType? searchType) => Qs("search_type", searchType);
- public SubmitAsyncSearchRequestDescriptor SourceExcludes(Elastic.Clients.Elasticsearch.Fields? sourceExcludes) => Qs("_source_excludes", sourceExcludes);
- public SubmitAsyncSearchRequestDescriptor SourceIncludes(Elastic.Clients.Elasticsearch.Fields? sourceIncludes) => Qs("_source_includes", sourceIncludes);
- public SubmitAsyncSearchRequestDescriptor SuggestField(Elastic.Clients.Elasticsearch.Field? suggestField) => Qs("suggest_field", suggestField);
- public SubmitAsyncSearchRequestDescriptor SuggestMode(Elastic.Clients.Elasticsearch.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.Duration? waitForCompletionTimeout) => Qs("wait_for_completion_timeout", waitForCompletionTimeout);
-
- public SubmitAsyncSearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices)
- {
- RouteValues.Optional("index", indices);
- return Self;
- }
-
- private IDictionary> AggregationsValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? CollapseValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor CollapseDescriptor { get; set; }
- private Action> CollapseDescriptorAction { get; set; }
- private ICollection? DocvalueFieldsValue { get; set; }
- private Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor DocvalueFieldsDescriptor { get; set; }
- private Action> DocvalueFieldsDescriptorAction { get; set; }
- private Action>[] DocvalueFieldsDescriptorActions { get; set; }
- private bool? ExplainValue { get; set; }
- private IDictionary? ExtValue { get; set; }
- private ICollection? FieldsValue { get; set; }
- private Elastic.Clients.Elasticsearch.QueryDsl.FieldAndFormatDescriptor FieldsDescriptor { get; set; }
- private Action> FieldsDescriptorAction { get; set; }
- private Action>[] FieldsDescriptorActions { get; set; }
- private int? FromValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.Highlight? HighlightValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.HighlightDescriptor HighlightDescriptor { get; set; }
- private Action> HighlightDescriptorAction { get; set; }
- private ICollection>? IndicesBoostValue { get; set; }
- private ICollection? KnnValue { get; set; }
- private Elastic.Clients.Elasticsearch.KnnSearchDescriptor KnnDescriptor { get; set; }
- private Action> KnnDescriptorAction { get; set; }
- private Action>[] KnnDescriptorActions { get; set; }
- private double? MinScoreValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReference? PitValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.PointInTimeReferenceDescriptor PitDescriptor { get; set; }
- private Action PitDescriptorAction { get; set; }
- private Elastic.Clients.Elasticsearch.QueryDsl.Query? PostFilterValue { get; set; }
- private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor PostFilterDescriptor { get; set; }
- private Action> PostFilterDescriptorAction { get; set; }
- private bool? ProfileValue { get; set; }
- private Elastic.Clients.Elasticsearch.QueryDsl.Query? QueryValue { get; set; }
- private Elastic.Clients.Elasticsearch.QueryDsl.QueryDescriptor QueryDescriptor { get; set; }
- private Action> QueryDescriptorAction { get; set; }
- private ICollection? RescoreValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.RescoreDescriptor RescoreDescriptor { get; set; }
- private Action> RescoreDescriptorAction { get; set; }
- private Action>[] RescoreDescriptorActions { get; set; }
- private IDictionary> RuntimeMappingsValue { get; set; }
- private IDictionary ScriptFieldsValue { get; set; }
- private ICollection? SearchAfterValue { get; set; }
- private bool? SeqNoPrimaryTermValue { get; set; }
- private int? SizeValue { get; set; }
- private Elastic.Clients.Elasticsearch.SlicedScroll? SliceValue { get; set; }
- private Elastic.Clients.Elasticsearch.SlicedScrollDescriptor SliceDescriptor { get; set; }
- private Action> SliceDescriptorAction { get; set; }
- private ICollection? SortValue { get; set; }
- private Elastic.Clients.Elasticsearch.SortOptionsDescriptor SortDescriptor { get; set; }
- private Action> SortDescriptorAction { get; set; }
- private Action>[] SortDescriptorActions { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceValue { get; set; }
- private ICollection? StatsValue { get; set; }
- private Elastic.Clients.Elasticsearch.Fields? StoredFieldsValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.Suggester? SuggestValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.SuggesterDescriptor SuggestDescriptor { get; set; }
- private Action> SuggestDescriptorAction { get; set; }
- private long? TerminateAfterValue { get; set; }
- private string? TimeoutValue { get; set; }
- private bool? TrackScoresValue { get; set; }
- private Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHitsValue { get; set; }
- private bool? VersionValue { get; set; }
-
- public SubmitAsyncSearchRequestDescriptor Aggregations(Func>, FluentDescriptorDictionary>> selector)
- {
- AggregationsValue = selector?.Invoke(new FluentDescriptorDictionary>());
- return Self;
- }
-
- public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapse? collapse)
- {
- CollapseDescriptor = null;
- CollapseDescriptorAction = null;
- CollapseValue = collapse;
- return Self;
- }
-
- public SubmitAsyncSearchRequestDescriptor Collapse(Elastic.Clients.Elasticsearch.Core.Search.FieldCollapseDescriptor descriptor)
- {
- CollapseValue = null;
- CollapseDescriptorAction = null;
- CollapseDescriptor = descriptor;
- return Self;
- }
-
- public SubmitAsyncSearchRequestDescriptor Collapse(Action> configure)
- {
- CollapseValue = null;
- CollapseDescriptor = null;
- CollapseDescriptorAction = configure;
- return Self;
+ public SubmitAsyncSearchRequestDescriptor()
+ {
+ Instance = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
}
+ public static explicit operator Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest instance) => new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor(instance);
+ public static implicit operator Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor descriptor) => descriptor.Instance;
+
///
///
- /// Array of wildcard (*) patterns. The request returns doc values for field
- /// names matching these patterns in the hits.fields property of the response.
+ /// A comma-separated list of index names to search; use