Skip to content

Commit 3ceefad

Browse files
committed
Merge branch 'feature/appdomain-warmer' into develop
2 parents d46a4e2 + a9fcf1c commit 3ceefad

File tree

130 files changed

+792
-717
lines changed

Some content is hidden

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

130 files changed

+792
-717
lines changed
19.5 KB
Binary file not shown.

dep/repositories.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<repositories>
33
<repository path="..\src\CodeGeneration\CodeGeneration.LowLevelClient\packages.config" />
44
<repository path="..\src\CodeGeneration\CodeGeneration.YamlTestsRunner\packages.config" />
5-
<repository path="..\src\Connections\Elasticsearch.Net.Connection.HttpClient\packages.config" />
65
<repository path="..\src\Connections\Elasticsearch.Net.Connection.Thrift\packages.config" />
76
<repository path="..\src\Elasticsearch.Net\packages.config" />
87
<repository path="..\src\Nest\packages.config" />

src/Nest/Domain/Connection/ConnectionSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ string IConnectionSettingsValues.DefaultIndex
5757
{
5858
get
5959
{
60-
if (this._defaultIndex.IsNullOrEmpty())
61-
throw new NullReferenceException("No default index set on connection!");
60+
//if (this._defaultIndex.IsNullOrEmpty())
61+
// throw new NullReferenceException("No default index set on connection!");
6262
return this._defaultIndex;
6363
}
6464
}

src/Nest/ElasticClient.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
3+
using System.IO;
4+
using System.Linq;
45
using System.Threading.Tasks;
56
using Elasticsearch.Net;
67
using Elasticsearch.Net.Connection;
@@ -99,14 +100,6 @@ D descriptor
99100
return badResponse;
100101
}
101102

102-
103-
private static R CreateValidInstance<R>(IElasticsearchResponse response) where R : BaseResponse
104-
{
105-
var r = (R)typeof(R).CreateInstance();
106-
((IResponseWithRequestInformation)r).RequestInformation = response;
107-
r.IsValid = true;
108-
return r;
109-
}
110103
private static R CreateInvalidInstance<R>(IElasticsearchResponse response) where R : BaseResponse
111104
{
112105
var r = (R)typeof(R).CreateInstance();
@@ -144,5 +137,16 @@ D descriptor
144137
}
145138

146139

140+
public static void Warmup()
141+
{
142+
var client = new ElasticClient(connection: new InMemoryConnection());
143+
var stream = new MemoryStream("{}".Utf8Bytes());
144+
client.Serializer.Serialize(new SearchDescriptor<object>());
145+
client.Serializer.Deserialize<SearchDescriptor<object>>(stream);
146+
var connection = new HttpConnection(new ConnectionSettings());
147+
client.RootNodeInfo();
148+
client.Search<object>(s=>s.MatchAll().Index("someindex"));
149+
}
150+
147151
}
148152
}

src/Nest/Resolvers/ElasticContractResolver.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ protected override IList<JsonProperty> CreateProperties(Type type, MemberSeriali
9797
defaultProperties = PropertiesOf<IQuery>(type, memberSerialization, defaultProperties, lookup);
9898
defaultProperties = PropertiesOf<IQueryContainer>(type, memberSerialization, defaultProperties, lookup);
9999
defaultProperties = PropertiesOf<IRequest>(type, memberSerialization, defaultProperties, lookup);
100-
//defaultProperties = PropertiesOf<ISearchRequest>(type, memberSerialization, defaultProperties, lookup);
101100
defaultProperties = PropertiesOf<IFilter>(type, memberSerialization, defaultProperties, lookup, append: true);
102101
defaultProperties = PropertiesOf<IFilterContainer>(type, memberSerialization, defaultProperties, lookup);
103102
defaultProperties = PropertiesOf<IRandomScoreFunction>(type, memberSerialization, defaultProperties, lookup);

src/Nest/Resolvers/SettingsContractResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public SettingsContractResolver(IContractResolver wrapped, IConnectionSettingsVa
2626
{
2727
this.ConnectionSettings = connectionSettings;
2828
this.Infer = new ElasticInferrer(this.ConnectionSettings);
29-
this._wrapped = wrapped;
29+
this._wrapped = wrapped ?? new DefaultContractResolver();
3030
}
3131

3232
public JsonContract ResolveContract(Type type)

src/Tests/Nest.Tests.Integration/Aggregations/BucketAggregationTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class BucketAggregationTests : IntegrationTests
1212
[Test]
1313
public void Terms()
1414
{
15-
var results = this._client.Search<ElasticsearchProject>(s => s
15+
var results = this.Client.Search<ElasticsearchProject>(s => s
1616
.Size(0)
1717
.Aggregations(a => a
1818
.Terms("bucket_agg", m => m.Field(p => p.Country))
@@ -27,7 +27,7 @@ public void Terms()
2727
[SkipVersion("0 - 1.0.9", "Significant terms aggregation not introduced until 1.1")]
2828
public void SignificantTerms()
2929
{
30-
var results = this._client.Search<ElasticsearchProject>(s => s
30+
var results = this.Client.Search<ElasticsearchProject>(s => s
3131
.Size(0)
3232
.Aggregations(a => a
3333
.Terms("term_items", gh=>gh
@@ -68,7 +68,7 @@ public void SignificantTerms()
6868
[Test]
6969
public void Histogram()
7070
{
71-
var results = this._client.Search<ElasticsearchProject>(s => s
71+
var results = this.Client.Search<ElasticsearchProject>(s => s
7272
.Size(0)
7373
.Aggregations(a => a
7474
.Histogram("bucket_agg", m => m
@@ -87,7 +87,7 @@ public void Histogram()
8787
[SkipVersion("0 - 1.0.9", "Percentiles aggregation not introduced until 1.1")]
8888
public void Percentiles()
8989
{
90-
var results = this._client.Search<ElasticsearchProject>(s => s
90+
var results = this.Client.Search<ElasticsearchProject>(s => s
9191
.Size(0)
9292
.Aggregations(a => a
9393
.Percentiles("bucket_agg", m => m
@@ -111,7 +111,7 @@ public void Percentiles()
111111
[SkipVersion("0 - 1.0.9", "Percentiles aggregation not introduced until 1.1")]
112112
public void PercentilesCustom()
113113
{
114-
var results = this._client.Search<ElasticsearchProject>(s => s
114+
var results = this.Client.Search<ElasticsearchProject>(s => s
115115
.Size(0)
116116
.Aggregations(a => a
117117
.Percentiles("bucket_agg", m => m
@@ -135,7 +135,7 @@ public void PercentilesCustom()
135135
[Test]
136136
public void GeoHash()
137137
{
138-
var results = this._client.Search<ElasticsearchProject>(s => s
138+
var results = this.Client.Search<ElasticsearchProject>(s => s
139139
.Size(0)
140140
.Aggregations(a => a
141141
.GeoHash("bucket_agg", m => m
@@ -152,7 +152,7 @@ public void GeoHash()
152152
[Test]
153153
public void Range()
154154
{
155-
var results = this._client.Search<ElasticsearchProject>(s => s
155+
var results = this.Client.Search<ElasticsearchProject>(s => s
156156
.Size(0)
157157
.Aggregations(a => a
158158
.Range("bucket_agg", m => m
@@ -171,7 +171,7 @@ public void Range()
171171
[Test]
172172
public void DateRange()
173173
{
174-
var results = this._client.Search<ElasticsearchProject>(s => s
174+
var results = this.Client.Search<ElasticsearchProject>(s => s
175175
.Size(0)
176176
.Aggregations(a => a
177177
.DateRange("bucket_agg", m => m
@@ -190,7 +190,7 @@ public void DateRange()
190190
[Test]
191191
public void IpRange()
192192
{
193-
var results = this._client.Search<ElasticsearchProject>(s => s
193+
var results = this.Client.Search<ElasticsearchProject>(s => s
194194
.Size(0)
195195
.Aggregations(a => a
196196
.IpRange("bucket_agg", dh => dh
@@ -206,7 +206,7 @@ public void IpRange()
206206
[Test]
207207
public void GeoDistance()
208208
{
209-
var results = this._client.Search<ElasticsearchProject>(s => s
209+
var results = this.Client.Search<ElasticsearchProject>(s => s
210210
.Size(0)
211211
.Aggregations(a => a
212212
.GeoDistance("bucket_agg", dh => dh
@@ -227,7 +227,7 @@ public void GeoDistance()
227227
[Test]
228228
public void DateHistogram()
229229
{
230-
var results = this._client.Search<ElasticsearchProject>(s => s
230+
var results = this.Client.Search<ElasticsearchProject>(s => s
231231
.Size(0)
232232
.Aggregations(a => a
233233
.DateHistogram("bucket_agg", dh => dh

src/Tests/Nest.Tests.Integration/Aggregations/MetricAggregationTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class MetricAggregationTests : IntegrationTests
1111
[Test]
1212
public void WrongFieldName()
1313
{
14-
var results = this._client.Search<ElasticsearchProject>(s => s
14+
var results = this.Client.Search<ElasticsearchProject>(s => s
1515
.Size(0)
1616
.Aggregations(a => a
1717
.Min("value_agg", t => t
@@ -28,7 +28,7 @@ public void WrongFieldName()
2828
[Test]
2929
public void Average()
3030
{
31-
var results = this._client.Search<ElasticsearchProject>(s => s
31+
var results = this.Client.Search<ElasticsearchProject>(s => s
3232
.Size(0)
3333
.Aggregations(a => a
3434
.Average("value_agg", t => t.Field(p => p.LOC))
@@ -42,7 +42,7 @@ public void Average()
4242
[Test]
4343
public void Min()
4444
{
45-
var results = this._client.Search<ElasticsearchProject>(s => s
45+
var results = this.Client.Search<ElasticsearchProject>(s => s
4646
.Size(0)
4747
.Aggregations(a => a
4848
.Min("value_agg", t => t.Field(p => p.LOC))
@@ -58,7 +58,7 @@ public void Min()
5858
[SkipVersion("0 - 1.0.9", "Cardinality aggregation not introduced until 1.1")]
5959
public void Cardinality()
6060
{
61-
var results = this._client.Search<ElasticsearchProject>(s => s
61+
var results = this.Client.Search<ElasticsearchProject>(s => s
6262
.Size(0)
6363
.Aggregations(a => a
6464
.Cardinality("bucket_agg", m => m
@@ -78,7 +78,7 @@ public void Cardinality()
7878
[Test]
7979
public void Max()
8080
{
81-
var results = this._client.Search<ElasticsearchProject>(s => s
81+
var results = this.Client.Search<ElasticsearchProject>(s => s
8282
.Size(0)
8383
.Aggregations(a => a
8484
.Max("value_agg", t => t.Field(p => p.LOC))
@@ -93,7 +93,7 @@ public void Max()
9393
[Test]
9494
public void Sum()
9595
{
96-
var results = this._client.Search<ElasticsearchProject>(s => s
96+
var results = this.Client.Search<ElasticsearchProject>(s => s
9797
.Size(0)
9898
.Aggregations(a => a
9999
.Sum("value_agg", t => t.Field(p => p.LOC))
@@ -108,7 +108,7 @@ public void Sum()
108108
[Test]
109109
public void ValueCount()
110110
{
111-
var results = this._client.Search<ElasticsearchProject>(s => s
111+
var results = this.Client.Search<ElasticsearchProject>(s => s
112112
.Size(0)
113113
.Aggregations(a => a
114114
.ValueCount("value_agg", t => t.Field(p => p.LOC))

src/Tests/Nest.Tests.Integration/Aggregations/NestedBucketAggregationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class NestedBucketAggregationTests : IntegrationTests
1111
[Test]
1212
public void Terms()
1313
{
14-
var results = this._client.Search<ElasticsearchProject>(s => s
14+
var results = this.Client.Search<ElasticsearchProject>(s => s
1515
.Size(0)
1616
.Aggregations(a => a
1717
.Nested("contributors", n => n

src/Tests/Nest.Tests.Integration/Aggregations/ParseResponseItemsTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ParseResponseItemsTests : IntegrationTests
1515
[Test]
1616
public void KeyItem()
1717
{
18-
var results = this._client.Search<ElasticsearchProject>(s => s
18+
var results = this.Client.Search<ElasticsearchProject>(s => s
1919
.Size(0)
2020
.Aggregations(a=>a
2121
.Terms("my_terms_agg", t=>t
@@ -41,7 +41,7 @@ public void KeyItem()
4141
[Test]
4242
public void ValueMetric()
4343
{
44-
var results = this._client.Search<ElasticsearchProject>(s => s
44+
var results = this.Client.Search<ElasticsearchProject>(s => s
4545
.Size(0)
4646
.Aggregations(a=>a
4747
.Average("my_avg", avg=>avg
@@ -60,7 +60,7 @@ public void ValueMetric()
6060
[Test]
6161
public void SingleBucket()
6262
{
63-
var results = this._client.Search<ElasticsearchProject>(s => s
63+
var results = this.Client.Search<ElasticsearchProject>(s => s
6464
.Size(0)
6565
.Aggregations(a=>a
6666
.Filter("my_filtered_agg", ff=>ff
@@ -85,7 +85,7 @@ public void SingleBucket()
8585
[Test]
8686
public void DateHistogramItem()
8787
{
88-
var results = this._client.Search<ElasticsearchProject>(s => s
88+
var results = this.Client.Search<ElasticsearchProject>(s => s
8989
.Size(0)
9090
.Aggregations(a=>a
9191
.DateHistogram("my_dateh", dh=>dh
@@ -107,7 +107,7 @@ public void DateHistogramItem()
107107
[Test]
108108
public void GeoDistanceItem()
109109
{
110-
var results = this._client.Search<ElasticsearchProject>(s => s
110+
var results = this.Client.Search<ElasticsearchProject>(s => s
111111
.Size(0)
112112
.Aggregations(a=>a
113113
.GeoDistance("my_geod", dh=>dh
@@ -134,7 +134,7 @@ public void GeoDistanceItem()
134134
[Test]
135135
public void RangeItem()
136136
{
137-
var results = this._client.Search<ElasticsearchProject>(s => s
137+
var results = this.Client.Search<ElasticsearchProject>(s => s
138138
.Size(0)
139139
.Aggregations(a=>a
140140
.Range("my_geod", dh=>dh
@@ -160,7 +160,7 @@ public void RangeItem()
160160
[Test]
161161
public void DateRangeItem()
162162
{
163-
var results = this._client.Search<ElasticsearchProject>(s => s
163+
var results = this.Client.Search<ElasticsearchProject>(s => s
164164
.Size(0)
165165
.Aggregations(a=>a
166166
.DateRange("my_geod", dh=>dh
@@ -184,7 +184,7 @@ public void DateRangeItem()
184184
[Test]
185185
public void IpRangeItem()
186186
{
187-
var results = this._client.Search<ElasticsearchProject>(s => s
187+
var results = this.Client.Search<ElasticsearchProject>(s => s
188188
.Size(0)
189189
.Aggregations(a=>a
190190
.IpRange("my_ip", dh=>dh
@@ -205,7 +205,7 @@ public void IpRangeItem()
205205
[Test]
206206
public void StatsMetric()
207207
{
208-
var results = this._client.Search<ElasticsearchProject>(s => s
208+
var results = this.Client.Search<ElasticsearchProject>(s => s
209209
.Size(0)
210210
.Aggregations(a=>a
211211
.Stats("my_stats", avg=>avg
@@ -228,7 +228,7 @@ public void StatsMetric()
228228
[Test]
229229
public void ExtendedStatsMetric()
230230
{
231-
var results = this._client.Search<ElasticsearchProject>(s => s
231+
var results = this.Client.Search<ElasticsearchProject>(s => s
232232
.Size(0)
233233
.Aggregations(a=>a
234234
.ExtendedStats("my_stats", avg=>avg

0 commit comments

Comments
 (0)