Skip to content

Commit f8894c8

Browse files
authored
Query and Container API enhancements + bug fixes (#6676)
* Incorporate latest code-gen changes * Bump SDK version * Updated query and container code gen * WIP non container fields * Complex query fixes * Update dependencies * Hide cachable expression property on field * Update intervals query test * Remove MGet tests which cause unit tests to hang. These need further review to understand the cause and resolve it so we can reintroduce them. * Support internals visible to on benchmarks * DescriptorValue prototypes * Query and container code gen improvements * Update test cases for intervals query serialise * Update exception message. * Improve container descriptor serialisation * Continue tests for intervals query * Update integration test matrix * Update container descriptor object variant storage + tests * Container serialization improvements and fixes * Improve container and field name query serialization * Final container converter serialization * WIP removal of variant interfaces * Fix internally tagged unions which require marker interfaces * Remove support for Migration APIs
1 parent fc5d848 commit f8894c8

File tree

245 files changed

+4348
-3495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+4348
-3495
lines changed

.ci/DockerFile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG DOTNET_VERSION=6.0.300
1+
ARG DOTNET_VERSION=6.0.401
22
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build
33

44
ARG USER_ID

.ci/make.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ OUTPUT_DIR="$repo/${output_folder}"
4242
REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}"
4343
mkdir -p "$OUTPUT_DIR"
4444

45-
DOTNET_VERSION=${DOTNET_VERSION-6.0.300}
45+
DOTNET_VERSION=${DOTNET_VERSION-6.0.401}
4646

4747
echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m"
4848
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"

.ci/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $ STACK_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests
3030
|-------------------------|-------------|-------------|
3131
| `STACK_VERSION` | `N/A` | The elasticsearch version to target
3232
| `TEST_SUITE` | `basic` | `free` or `platinum` sets which test suite to run and which container to run against. |
33-
| `DOTNET_VERSION` | `6.0.300` | The .NET sdk version used to grab the proper container |
33+
| `DOTNET_VERSION` | `6.0.401` | The .NET sdk version used to grab the proper container |
3434

3535
If you want to manually spin up elasticsearch for these tests and call the runner afterwards you can use
3636

.ci/run-repository.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ param(
1414
$NODE_NAME,
1515

1616
[string]
17-
$DOTNET_VERSION = "6.0.300"
17+
$DOTNET_VERSION = "6.0.401"
1818
)
1919

2020
$ESC = [char]27

.ci/run-repository.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
99
source $script_path/functions/imports.sh
1010
set -euo pipefail
1111

12-
DOTNET_VERSION=${DOTNET_VERSION-6.0.300}
12+
DOTNET_VERSION=${DOTNET_VERSION-6.0.401}
1313
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
1414
elasticsearch_container=${elasticsearch_container-}
1515

.ci/run-tests.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param (
88
$TEST_SUITE = "free",
99

1010
[string]
11-
$DOTNET_VERSION = "6.0.300"
11+
$DOTNET_VERSION = "6.0.401"
1212
)
1313

1414
$ESC = [char]27

.ci/test-matrix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ TEST_SUITE:
88
- platinum
99

1010
DOTNET_VERSION:
11-
- 6.0.300
11+
- 6.0.401
1212

1313
exclude: ~

.github/workflows/integration-jobs.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ jobs:
2424
stack_version: [
2525
'8.1.3',
2626
'8.2.3',
27-
'8.3.2',
28-
'8.4.0-SNAPSHOT',
27+
'8.3.3',
28+
'8.4.2',
29+
'8.5.0-SNAPSHOT',
2930
'latest-8'
3031
]
3132

@@ -34,7 +35,7 @@ jobs:
3435
uses: actions/checkout@v2
3536
- uses: actions/setup-dotnet@v1
3637
with:
37-
dotnet-version: '6.0.300'
38+
dotnet-version: '6.0.401'
3839
- uses: actions/cache@v2
3940
with:
4041
path: ~/.nuget/packages

.github/workflows/make-bump.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
# Add version and backport labels automatically
3636
- uses: actions/setup-dotnet@v1
3737
with:
38-
dotnet-version: '6.0.300'
38+
dotnet-version: '6.0.401'
3939
- name: Install dotnet-script
4040
run: dotnet tool install release-notes --tool-path dotnet-tool
4141

.github/workflows/make-release-notes.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
- uses: actions/setup-dotnet@v1
5353
with:
54-
dotnet-version: '6.0.300'
54+
dotnet-version: '6.0.401'
5555
- name: Install dotnet-script
5656
run: dotnet tool install release-notes --tool-path dotnet-tool
5757

.github/workflows/stale-jobs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v2
2525
- uses: actions/setup-dotnet@v1
2626
with:
27-
dotnet-version: '6.0.300'
27+
dotnet-version: '6.0.401'
2828
- uses: actions/cache@v2
2929
with:
3030
path: ~/.nuget/packages

.github/workflows/test-jobs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v2
2424
- uses: actions/setup-dotnet@v1
2525
with:
26-
dotnet-version: '6.0.300'
26+
dotnet-version: '6.0.401'
2727
- uses: actions/cache@v2
2828
with:
2929
path: ~/.nuget/packages
@@ -53,7 +53,7 @@ jobs:
5353
uses: actions/checkout@v2
5454
- uses: actions/setup-dotnet@v1
5555
with:
56-
dotnet-version: '6.0.300'
56+
dotnet-version: '6.0.401'
5757
- uses: actions/cache@v2
5858
with:
5959
path: ~/.nuget/packages

.github/workflows/unified-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/checkout@v2
2929
- uses: actions/setup-dotnet@v1
3030
with:
31-
dotnet-version: '6.0.300'
31+
dotnet-version: '6.0.401'
3232

3333
- run: "./.ci/make.sh assemble ${{ matrix.stack_version }}"
3434
name: Assemble ${{ matrix.stack_version }}

benchmarks/Benchmarks/Benchmarks.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
<TargetFramework>net6.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
8+
<SignAssembly>True</SignAssembly>
9+
<AssemblyOriginatorKeyFile>$(SolutionRoot)\build\keys\keypair.snk</AssemblyOriginatorKeyFile>
810
</PropertyGroup>
911

1012
<ItemGroup>
1113
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
1214
</ItemGroup>
1315

1416
<ItemGroup>
15-
<ProjectReference Include="..\..\src\Elastic.Clients.Elasticsearch\Elastic.Clients.Elasticsearch.csproj" />
17+
<ProjectReference Include="$(SolutionRoot)\src\Elastic.Clients.Elasticsearch\Elastic.Clients.Elasticsearch.csproj" />
1618
<PackageReference Include="NEST" Version="7.16.0" />
1719
</ItemGroup>
1820

benchmarks/Benchmarks/Program.cs

+136
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,155 @@
88
using BenchmarkDotNet.Reports;
99
using BenchmarkDotNet.Running;
1010
using Elastic.Clients.Elasticsearch;
11+
using Elastic.Clients.Elasticsearch.Enrich;
12+
using Elastic.Clients.Elasticsearch.QueryDsl;
1113
using Elastic.Transport;
1214
using Nest;
1315
using System.Globalization;
1416
using System.Text;
17+
using Policy = Elastic.Clients.Elasticsearch.Enrich.Policy;
1518

1619
var config = ManualConfig.Create(DefaultConfig.Instance);
1720
config.SummaryStyle = new SummaryStyle(CultureInfo.CurrentCulture, true, BenchmarkDotNet.Columns.SizeUnit.B, null);
1821
config.AddDiagnoser(MemoryDiagnoser.Default);
1922

2023
BenchmarkRunner.Run<Benchmarks.BulkIngest>(config);
2124

25+
//var thing = new Benchmarks.DescriptorValues();
26+
//thing.Setup();
27+
28+
//var a = new EnrichPutPolicyRequestDescriptorV2<Benchmarks.SampleData>("test");
29+
30+
//a.Match(new Policy { Name = "test-name" });
31+
32+
//var settings = new ElasticsearchClientSettings();
33+
//var serializer = new DefaultRequestResponseSerializer(settings);
34+
//var stream = new MemoryStream();
35+
36+
//serializer.Serialize(a, stream);
37+
38+
//stream.Position = 0;
39+
//var sr = new StreamReader(stream);
40+
//var result = sr.ReadToEnd();
41+
42+
//Console.ReadKey();
43+
2244
namespace Benchmarks
2345
{
46+
//public class DescriptorValues
47+
//{
48+
// private EnrichPutPolicyRequestDescriptor<SampleData>? _data1;
49+
// private EnrichPutPolicyRequestDescriptorV2<SampleData>? _data2;
50+
// private EnrichPutPolicyRequestDescriptorV3<SampleData>? _data3;
51+
// private EnrichPutPolicyRequestDescriptorV4<SampleData>? _data4;
52+
53+
// //private Existing<SampleData>? _basicData1;
54+
// //private NewV1<SampleData>? _basicData2;
55+
// //private NewV2<SampleData>? _basicData3;
56+
57+
// private readonly EnrichPutPolicyRequestDescriptor<SampleData> _existing = new("test");
58+
// private readonly EnrichPutPolicyRequestDescriptorV2<SampleData> _newV1 = new("test");
59+
// private readonly EnrichPutPolicyRequestDescriptorV3<SampleData> _newV2 = new("test");
60+
// private readonly EnrichPutPolicyRequestDescriptorV4<SampleData> _newV3 = new("test");
61+
// private readonly Policy? _policy = new() { Name = "TEST" };
62+
63+
// private readonly EnrichPutPolicyRequestDescriptor<SampleData> _serializableExisting = new("test");
64+
// private readonly EnrichPutPolicyRequestDescriptorV2<SampleData> _serializableNewV1 = new("test");
65+
// private readonly EnrichPutPolicyRequestDescriptorV3<SampleData> _serializableNewV2 = new("test");
66+
// private readonly EnrichPutPolicyRequestDescriptorV4<SampleData> _serializableNewV3 = new("test");
67+
68+
// private static readonly ElasticsearchClientSettings Settings = new();
69+
70+
// private readonly DefaultRequestResponseSerializer _serializer = new(Settings);
71+
// private readonly MemoryStream _stream = new();
72+
73+
// [GlobalSetup]
74+
// public void Setup()
75+
// {
76+
// _serializableExisting.GeoMatch(_policy);
77+
// _serializableNewV1.GeoMatch(_policy);
78+
// _serializableNewV2.GeoMatch(_policy);
79+
// _serializableNewV3.GeoMatch(_policy);
80+
// }
81+
82+
// [Benchmark]
83+
// public void Existing() => _data1 = new EnrichPutPolicyRequestDescriptor<SampleData>("name");
84+
85+
// [Benchmark]
86+
// public void NewV1() => _data2 = new EnrichPutPolicyRequestDescriptorV2<SampleData>("name");
87+
88+
// [Benchmark]
89+
// public void NewV2() => _data3 = new EnrichPutPolicyRequestDescriptorV3<SampleData>("name");
90+
91+
// [Benchmark]
92+
// public void NewV3() => _data4 = new EnrichPutPolicyRequestDescriptorV4<SampleData>("name");
93+
94+
// //[Benchmark]
95+
// //public void Existing() => _basicData1 = new Existing<SampleData>();
96+
97+
// //[Benchmark]
98+
// //public void NewV1() => _basicData2 = new NewV1<SampleData>();
99+
100+
// //[Benchmark]
101+
// //public void NewV2() => _basicData3 = new NewV2<SampleData>();
102+
103+
// [Benchmark]
104+
// public void SetExisting() => _existing.GeoMatch(_policy);
105+
106+
// [Benchmark]
107+
// public void SetNewV1() => _newV1.GeoMatch(_policy);
108+
109+
// [Benchmark]
110+
// public void SetNewV2() => _newV2.GeoMatch(_policy);
111+
112+
// [Benchmark]
113+
// public void SetNewV3() => _newV3.GeoMatch(_policy);
114+
115+
// [Benchmark]
116+
// public void SerialiseExisting()
117+
// {
118+
// _stream.Position = 0;
119+
// _serializer.Serialize(_serializableExisting, _stream);
120+
// }
121+
122+
// [Benchmark]
123+
// public void SerialiseNewV1()
124+
// {
125+
// _stream.Position = 0;
126+
// _serializer.Serialize(_serializableNewV1, _stream);
127+
// }
128+
129+
// [Benchmark]
130+
// public void SerialiseNewV2()
131+
// {
132+
// _stream.Position = 0;
133+
// _serializer.Serialize(_serializableNewV2, _stream);
134+
// }
135+
136+
// [Benchmark]
137+
// public void SerialiseNewV3()
138+
// {
139+
// _stream.Position = 0;
140+
// _serializer.Serialize(_serializableNewV3, _stream);
141+
// }
142+
//}
143+
144+
// RESULT OF ABOVE:
145+
//| Method | Mean [ns] | Error [ns] | StdDev [ns] | Gen 0 | Gen 1 | Allocated [B] |
146+
//|------------------ |-----------:|-----------:|------------:|-------:|-------:|--------------:|
147+
//| Existing | 116.408 ns | 2.1955 ns | 2.1563 ns | 0.0942 | 0.0002 | 592 B |
148+
//| NewV1 | 113.021 ns | 1.8475 ns | 1.8145 ns | 0.0943 | 0.0004 | 592 B |
149+
//| NewV2 | 115.728 ns | 2.2291 ns | 2.0851 ns | 0.0905 | 0.0002 | 568 B |
150+
//| NewV3 | 112.813 ns | 2.2198 ns | 3.1118 ns | 0.0867 | 0.0002 | 544 B |
151+
//| SetExisting | 1.688 ns | 0.0384 ns | 0.0340 ns | - | - | - |
152+
//| SetNewV1 | 2.200 ns | 0.0232 ns | 0.0217 ns | - | - | - |
153+
//| SetNewV2 | 2.555 ns | 0.0289 ns | 0.0256 ns | - | - | - |
154+
//| SetNewV3 | 1.691 ns | 0.0306 ns | 0.0286 ns | - | - | - |
155+
//| SerialiseExisting | 461.120 ns | 9.0066 ns | 8.4248 ns | 0.0687 | - | 432 B |
156+
//| SerialiseNewV1 | 472.239 ns | 8.4655 ns | 7.9186 ns | 0.0687 | - | 432 B |
157+
//| SerialiseNewV2 | 476.059 ns | 9.2350 ns | 10.2647 ns | 0.0687 | - | 432 B |
158+
//| SerialiseNewV3 | 483.717 ns | 9.5424 ns | 8.9260 ns | 0.0687 | - | 432 B |
159+
24160
public class BulkIngest
25161
{
26162
//private static readonly List<SampleData> Data = Enumerable.Range(0, 100).Select(r => new SampleData()).ToList();

benchmarks/Benchmarks/packages.lock.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@
11371137
"elastic.clients.elasticsearch": {
11381138
"type": "Project",
11391139
"dependencies": {
1140-
"Elastic.Transport": "0.3.2"
1140+
"Elastic.Transport": "[0.3.2, )"
11411141
}
11421142
}
11431143
}

benchmarks/Profiling/packages.lock.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"elastic.clients.elasticsearch": {
7474
"type": "Project",
7575
"dependencies": {
76-
"Elastic.Transport": "0.3.2"
76+
"Elastic.Transport": "[0.3.2, )"
7777
}
7878
}
7979
}

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.300",
3+
"version": "6.0.401",
44
"rollForward": "minor",
55
"allowPrerelease": false
66
},

src/Elastic.Clients.Elasticsearch.JsonNetSerializer/packages.lock.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"elastic.clients.elasticsearch": {
106106
"type": "Project",
107107
"dependencies": {
108-
"Elastic.Transport": "0.3.2"
108+
"Elastic.Transport": "[0.3.2, )"
109109
}
110110
}
111111
},
@@ -256,7 +256,7 @@
256256
"elastic.clients.elasticsearch": {
257257
"type": "Project",
258258
"dependencies": {
259-
"Elastic.Transport": "0.3.2"
259+
"Elastic.Transport": "[0.3.2, )"
260260
}
261261
}
262262
},
@@ -516,9 +516,9 @@
516516
"elastic.clients.elasticsearch": {
517517
"type": "Project",
518518
"dependencies": {
519-
"Elastic.Transport": "0.3.2",
520-
"System.Reflection.Emit": "4.3.0",
521-
"System.Reflection.Emit.Lightweight": "4.3.0"
519+
"Elastic.Transport": "[0.3.2, )",
520+
"System.Reflection.Emit": "[4.3.0, )",
521+
"System.Reflection.Emit.Lightweight": "[4.3.0, )"
522522
}
523523
}
524524
},
@@ -660,7 +660,7 @@
660660
"elastic.clients.elasticsearch": {
661661
"type": "Project",
662662
"dependencies": {
663-
"Elastic.Transport": "0.3.2"
663+
"Elastic.Transport": "[0.3.2, )"
664664
}
665665
}
666666
},
@@ -762,7 +762,7 @@
762762
"elastic.clients.elasticsearch": {
763763
"type": "Project",
764764
"dependencies": {
765-
"Elastic.Transport": "0.3.2"
765+
"Elastic.Transport": "[0.3.2, )"
766766
}
767767
}
768768
},
@@ -864,7 +864,7 @@
864864
"elastic.clients.elasticsearch": {
865865
"type": "Project",
866866
"dependencies": {
867-
"Elastic.Transport": "0.3.2"
867+
"Elastic.Transport": "[0.3.2, )"
868868
}
869869
}
870870
}

0 commit comments

Comments
 (0)