Skip to content

Commit 0727c93

Browse files
committed
Address 9.0-preview feedback (#8497)
1 parent 6d596dd commit 0727c93

13 files changed

+633
-17
lines changed

docs/release-notes/breaking-changes.md

+37-14
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ Breaking changes can impact your Elastic applications, potentially disrupting no
2626
- [1. Container types](#1-container-types)
2727
- [2. Removal of certain generic request descriptors](#2-removal-of-certain-generic-request-descriptors)
2828
- [3. Removal of certain descriptor constructors and related request APIs](#3-removal-of-certain-descriptor-constructors-and-related-request-apis)
29-
- [4. Date / Time / Duration values](#4-date--time--duration-values)
29+
- [4. Date / Time / Duration values](#4-date-time-duration-values)
3030
- [5. `ExtendedBounds`](#5-extendedbounds)
3131
- [6. `Field.Format`](#6-fieldformat)
3232
- [7. `Field`/`Fields` semantics](#7-fieldfields-semantics)
3333
- [8. `FieldValue`](#8-fieldvalue)
3434
- [9. `FieldSort`](#9-fieldsort)
35-
- [10. Descriptor types `class` -\> `struct`](#10-descriptor-types-class---struct)
35+
- [10. Descriptor types `class` -\> `struct`](#10-descriptor-types-class-struct)
3636

3737
### Breaking changes
3838

39-
#### 1. Container types
39+
#### 1. Container types [1-container-types]
4040

4141
**Impact**: High.
4242

@@ -67,7 +67,20 @@ new SearchRequest
6767
};
6868
```
6969

70-
#### 2. Removal of certain generic request descriptors
70+
Previously required methods like e.g. `TryGet<TVariant>(out)` have been removed.
71+
72+
The new recommended way of inspecting container types is to use simple pattern matching:
73+
74+
```csharp
75+
var query = new Query();
76+
77+
if (query.Nested is { } nested)
78+
{
79+
// We have a nested query.
80+
}
81+
```
82+
83+
#### 2. Removal of certain generic request descriptors [2-removal-of-certain-generic-request-descriptors]
7184

7285
**Impact**: High.
7386

@@ -126,7 +139,7 @@ List of affected descriptors:
126139
- `TokenizationConfigDescriptor<TDocument>`
127140
- `UpdateDataFrameAnalyticsRequestDescriptor<TDocument>`
128141

129-
#### 3. Removal of certain descriptor constructors and related request APIs
142+
#### 3. Removal of certain descriptor constructors and related request APIs [3-removal-of-certain-descriptor-constructors-and-related-request-apis]
130143

131144
**Impact**: High.
132145

@@ -159,53 +172,63 @@ new IndexRequestDescriptor(document, "my_index", Id.From(document));
159172
await client.IndexAsync(document, "my_index", Id.From(document), ...);
160173
```
161174

162-
#### 4. Date / Time / Duration values
175+
#### 4. Date / Time / Duration values [4-date-time-duration-values]
163176

164177
**Impact**: High.
165178

166179
In places where previously `long` or `double` was used to represent a date/time/duration value, `DateTimeOffset` or `TimeSpan` is now used instead.
167180

168-
#### 5. `ExtendedBounds`
181+
#### 5. `ExtendedBounds` [5-extendedbounds]
169182

170183
**Impact**: High.
171184

172185
Removed `ExtendedBoundsDate`/`ExtendedBoundsDateDescriptor`, `ExtendedBoundsFloat`/`ExtendedBoundsFloatDescriptor`.
173186

174187
Replaced by `ExtendedBounds<T>`, `ExtendedBoundsOfFieldDateMathDescriptor`, and `ExtendedBoundsOfDoubleDescriptor`.
175188

176-
#### 6. `Field.Format`
189+
#### 6. `Field.Format` [6-fieldformat]
177190

178191
**Impact**: Low.
179192

180193
Removed `Field.Format` property and corresponding constructor and inferrer overloads.
181194

182195
This property has not been used for some time (replaced by the `FieldAndFormat` type).
183196

184-
#### 7. `Field`/`Fields` semantics
197+
#### 7. `Field`/`Fields` semantics [7-fieldfields-semantics]
185198

186199
**Impact**: Low.
187200

188201
`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`.
189202

190-
This makes implicit conversions to `Field` more user-friendly without requiring the null-forgiveness operator (`!`) ([read more](index.md#field-name-inference)).
203+
This makes implicit conversions to `Field` more user-friendly without requiring the null-forgiveness operator (`!`) ([read more](index.md#5-field-name-inference)).
191204

192-
#### 8. `FieldValue`
205+
#### 8. `FieldValue` [8-fieldvalue]
193206

194207
**Impact**: Low.
195208

196209
Removed `FieldValue.IsLazyDocument`, `FieldValue.IsComposite`, and the corresponding members in the `FieldValue.ValueKind` enum.
197210

198211
These values have not been used for some time.
199212

200-
#### 9. `FieldSort`
213+
#### 9. `FieldSort` [9-fieldsort]
214+
215+
**Impact**: High.
216+
217+
Removed `FieldSort` parameterless constructor.
218+
219+
Please use the new constructor instead:
220+
221+
```csharp
222+
public FieldSort(Elastic.Clients.Elasticsearch.Field field)
223+
```
201224

202225
**Impact**: Low.
203226

204227
Removed static `FieldSort.Empty` member.
205228

206-
Sorting got reworked which makes this member obsolete ([read more](index.md#sorting)).
229+
Sorting got reworked which makes this member obsolete ([read more](index.md#8-sorting)).
207230

208-
#### 10. Descriptor types `class` -> `struct`
231+
#### 10. Descriptor types `class` -> `struct` [10-descriptor-types-class-struct]
209232

210233
**Impact**: Low.
211234

docs/release-notes/index.md

+13
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,19 @@ var agg = new Aggregation
300300
};
301301
```
302302

303+
Previously required methods like e.g. `TryGet<TVariant>(out)` have been removed.
304+
305+
The new recommended way of inspecting container types is to use simple pattern matching:
306+
307+
```csharp
308+
var query = new Query();
309+
310+
if (query.Nested is { } nested)
311+
{
312+
// We have a nested query.
313+
}
314+
```
315+
303316
:::{warning}
304317

305318
A container can still only contain a single variant. Setting multiple variants at once is invalid.

docs/release-notes/known-issues.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ navigation_title: "Known issues"
55

66
# Elasticsearch .NET Client known issues [elasticsearch-net-client-known-issues]
77

8+
Known issues are significant defects or limitations that may impact your implementation. These issues are actively being worked on and will be addressed in a future release. Review the Elasticsearch .NET Client known issues to help you make informed decisions, such as upgrading to a new version.
9+
810
% Use the following template to add entries to this page.
911

1012
% :::{dropdown} Title of known issue
@@ -17,4 +19,6 @@ navigation_title: "Known issues"
1719
% **Resolved**
1820
% On [Month/Day/Year], this issue was resolved.
1921

20-
:::
22+
:::
23+
24+
Known issues are tracked on [GitHub](https://github.com/elastic/elasticsearch-net/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Category%3A%20Bug%22).

src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs

+16
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,14 @@ public virtual Elastic.Clients.Elasticsearch.Cluster.HealthResponse Health(Elast
388388
return DoRequest<Elastic.Clients.Elasticsearch.Cluster.HealthRequest, Elastic.Clients.Elasticsearch.Cluster.HealthResponse, Elastic.Clients.Elasticsearch.Cluster.HealthRequestParameters>(request);
389389
}
390390

391+
public virtual Elastic.Clients.Elasticsearch.Cluster.HealthResponse Health<TDocument>()
392+
{
393+
var builder = new Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor<TDocument>();
394+
var request = builder.Instance;
395+
request.BeforeRequest();
396+
return DoRequest<Elastic.Clients.Elasticsearch.Cluster.HealthRequest, Elastic.Clients.Elasticsearch.Cluster.HealthResponse, Elastic.Clients.Elasticsearch.Cluster.HealthRequestParameters>(request);
397+
}
398+
391399
public virtual Elastic.Clients.Elasticsearch.Cluster.HealthResponse Health<TDocument>(System.Action<Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor<TDocument>> action)
392400
{
393401
var builder = new Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor<TDocument>();
@@ -446,6 +454,14 @@ public virtual Elastic.Clients.Elasticsearch.Cluster.HealthResponse Health<TDocu
446454
return DoRequestAsync<Elastic.Clients.Elasticsearch.Cluster.HealthRequest, Elastic.Clients.Elasticsearch.Cluster.HealthResponse, Elastic.Clients.Elasticsearch.Cluster.HealthRequestParameters>(request, cancellationToken);
447455
}
448456

457+
public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Cluster.HealthResponse> HealthAsync<TDocument>(System.Threading.CancellationToken cancellationToken = default)
458+
{
459+
var builder = new Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor<TDocument>();
460+
var request = builder.Instance;
461+
request.BeforeRequest();
462+
return DoRequestAsync<Elastic.Clients.Elasticsearch.Cluster.HealthRequest, Elastic.Clients.Elasticsearch.Cluster.HealthResponse, Elastic.Clients.Elasticsearch.Cluster.HealthRequestParameters>(request, cancellationToken);
463+
}
464+
449465
public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.Cluster.HealthResponse> HealthAsync<TDocument>(System.Action<Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor<TDocument>> action, System.Threading.CancellationToken cancellationToken = default)
450466
{
451467
var builder = new Elastic.Clients.Elasticsearch.Cluster.HealthRequestDescriptor<TDocument>();

0 commit comments

Comments
 (0)