Skip to content

Release 9.0 #8485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .buildkite/DockerFile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/run-repository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ param(
$NODE_NAME,

[string]
$DOTNET_VERSION = "8.0.400"
$DOTNET_VERSION = "9.0.100"
)

$ESC = [char]27
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-}

Expand Down
2 changes: 1 addition & 1 deletion .buildkite/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param (
$TEST_SUITE = "free",

[string]
$DOTNET_VERSION = "8.0.400"
$DOTNET_VERSION = "9.0.100"
)

$ESC = [char]27
Expand Down
2 changes: 1 addition & 1 deletion .ci/DockerFile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .ci/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .ci/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .ci/run-repository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ param(
$NODE_NAME,

[string]
$DOTNET_VERSION = "8.0.400"
$DOTNET_VERSION = "9.0.100"
)

$ESC = [char]27
Expand Down
2 changes: 1 addition & 1 deletion .ci/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-}

Expand Down
2 changes: 1 addition & 1 deletion .ci/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param (
$TEST_SUITE = "free",

[string]
$DOTNET_VERSION = "8.0.400"
$DOTNET_VERSION = "9.0.100"
)

$ESC = [char]27
Expand Down
2 changes: 1 addition & 1 deletion .ci/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ TEST_SUITE:
- platinum

DOTNET_VERSION:
- 8.0.400
- 9.0.100

exclude: ~
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@
<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>

<PropertyGroup>
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
</Project>
7 changes: 0 additions & 7 deletions Elasticsearch.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/Versioning.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/scripts.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>Exe</OutputType>
<!-- Type Providers are restored using net461, fine for netcoreapp2.2 so we kill the warning -->
<NoWarn>$(NoWarn);NU1701</NoWarn>
Expand Down
206 changes: 196 additions & 10 deletions docs/release-notes/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,208 @@
---

# 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**<br> Impact of the breaking change.
% **Action**<br> 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**<br> Impact of the breaking change.
% **Action**<br> Steps for mitigating deprecation impact.
% ::::
### Overview

- [1. Container types](#1-container-types)

Check failure on line 26 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`1-container-types` does not exist in release-notes/breaking-changes.md.
- [2. Removal of certain generic request descriptors](#2-removal-of-certain-generic-request-descriptors)

Check failure on line 27 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`2-removal-of-certain-generic-request-descriptors` does not exist in release-notes/breaking-changes.md.
- [3. Removal of certain descriptor constructors and related request APIs](#3-removal-of-certain-descriptor-constructors-and-related-request-apis)

Check failure on line 28 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`3-removal-of-certain-descriptor-constructors-and-related-request-apis` does not exist in release-notes/breaking-changes.md.
- [4. Date / Time / Duration values](#4-date--time--duration-values)

Check failure on line 29 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`4-date--time--duration-values` does not exist in release-notes/breaking-changes.md.
- [5. `ExtendedBounds`](#5-extendedbounds)

Check failure on line 30 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`5-extendedbounds` does not exist in release-notes/breaking-changes.md.
- [6. `Field.Format`](#6-fieldformat)

Check failure on line 31 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`6-fieldformat` does not exist in release-notes/breaking-changes.md.
- [7. `Field`/`Fields` semantics](#7-fieldfields-semantics)

Check failure on line 32 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`7-fieldfields-semantics` does not exist in release-notes/breaking-changes.md.
- [8. `FieldValue`](#8-fieldvalue)

Check failure on line 33 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`8-fieldvalue` does not exist in release-notes/breaking-changes.md.
- [9. `FieldSort`](#9-fieldsort)

Check failure on line 34 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`9-fieldsort` does not exist in release-notes/breaking-changes.md.
- [10. Descriptor types `class` -\> `struct`](#10-descriptor-types-class---struct)

Check failure on line 35 in docs/release-notes/breaking-changes.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

`10-descriptor-types-class---struct` does not exist in release-notes/breaking-changes.md.

### 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<TDocument>` should become just `AsyncSearchStatusRequestDescriptor`.

List of affected descriptors:

- `AsyncQueryDeleteRequestDescriptor<TDocument>`
- `AsyncQueryGetRequestDescriptor<TDocument>`
- `AsyncSearchStatusRequestDescriptor<TDocument>`
- `DatabaseConfigurationDescriptor<TDocument>`
- `DatabaseConfigurationFullDescriptor<TDocument>`
- `DeleteAsyncRequestDescriptor<TDocument>`
- `DeleteAsyncSearchRequestDescriptor<TDocument>`
- `DeleteDataFrameAnalyticsRequestDescriptor<TDocument>`
- `DeleteGeoipDatabaseRequestDescriptor<TDocument>`
- `DeleteIpLocationDatabaseRequestDescriptor<TDocument>`
- `DeleteJobRequestDescriptor<TDocument>`
- `DeletePipelineRequestDescriptor<TDocument>`
- `DeleteScriptRequestDescriptor<TDocument>`
- `DeleteSynonymRequestDescriptor<TDocument>`
- `EqlDeleteRequestDescriptor<TDocument>`
- `EqlGetRequestDescriptor<TDocument>`
- `GetAsyncRequestDescriptor<TDocument>`
- `GetAsyncSearchRequestDescriptor<TDocument>`
- `GetAsyncStatusRequestDescriptor<TDocument>`
- `GetDataFrameAnalyticsRequestDescriptor<TDocument>`
- `GetDataFrameAnalyticsStatsRequestDescriptor<TDocument>`
- `GetEqlStatusRequestDescriptor<TDocument>`
- `GetGeoipDatabaseRequestDescriptor<TDocument>`
- `GetIpLocationDatabaseRequestDescriptor<TDocument>`
- `GetJobsRequestDescriptor<TDocument>`
- `GetPipelineRequestDescriptor<TDocument>`
- `GetRollupCapsRequestDescriptor<TDocument>`
- `GetRollupIndexCapsRequestDescriptor<TDocument>`
- `GetScriptRequestDescriptor<TDocument>`
- `GetSynonymRequestDescriptor<TDocument>`
- `IndexModifyDataStreamActionDescriptor<TDocument>`
- `PreprocessorDescriptor<TDocument>`
- `PutGeoipDatabaseRequestDescriptor<TDocument>`
- `PutIpLocationDatabaseRequestDescriptor<TDocument>`
- `PutScriptRequestDescriptor<TDocument>`
- `PutSynonymRequestDescriptor<TDocument>`
- `QueryVectorBuilderDescriptor<TDocument>`
- `RankDescriptor<TDocument>`
- `RenderSearchTemplateRequestDescriptor<TDocument>`
- `SmoothingModelDescriptor<TDocument>`
- `StartDataFrameAnalyticsRequestDescriptor<TDocument>`
- `StartJobRequestDescriptor<TDocument>`
- `StopDataFrameAnalyticsRequestDescriptor<TDocument>`
- `StopJobRequestDescriptor<TDocument>`
- `TokenizationConfigDescriptor<TDocument>`
- `UpdateDataFrameAnalyticsRequestDescriptor<TDocument>`

#### 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<T>`, `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`.
Loading
Loading