Skip to content

Commit 0159b16

Browse files
committed
Generate docs and tag for release
1 parent cb776d6 commit 0159b16

33 files changed

+120
-165
lines changed

docs/aggregations.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ In addition to the buckets themselves, the bucket aggregations also compute and
134134

135135
* <<geo-tile-grid-aggregation-usage,Geo Tile Grid Aggregation Usage>>
136136

137+
* <<geo-tile-grid-aggregation-usage,Geo Tile Grid Aggregation Usage>>
138+
137139
* <<global-aggregation-usage,Global Aggregation Usage>>
138140

139141
* <<histogram-aggregation-usage,Histogram Aggregation Usage>>
@@ -193,6 +195,8 @@ include::aggregations/bucket/geo-hash-grid/geo-hash-grid-aggregation-usage.ascii
193195

194196
include::aggregations/bucket/geo-hash-tile/geo-tile-grid-aggregation-usage.asciidoc[]
195197

198+
include::aggregations/bucket/geo-tile-grid/geo-tile-grid-aggregation-usage.asciidoc[]
199+
196200
include::aggregations/bucket/global/global-aggregation-usage.asciidoc[]
197201

198202
include::aggregations/bucket/histogram/histogram-aggregation-usage.asciidoc[]
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/7.0
2+
3+
:github: https://github.com/elastic/elasticsearch-net
4+
5+
:nuget: https://www.nuget.org/packages
6+
7+
////
8+
IMPORTANT NOTE
9+
==============
10+
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/7.x/src/Tests/Tests/Aggregations/Bucket/GeoTileGrid/GeoTileGridAggregationUsageTests.cs.
11+
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,
12+
please modify the original csharp file found at the link and submit the PR with that change. Thanks!
13+
////
14+
15+
[[geo-tile-grid-aggregation-usage]]
16+
=== Geo Tile Grid Aggregation Usage
17+
18+
==== Fluent DSL example
19+
20+
[source,csharp]
21+
----
22+
a => a
23+
.GeoTile("my_geotile", g => g
24+
.Field(p => p.LocationPoint)
25+
.Precision(GeoTilePrecision.Precision3)
26+
.Size(1000)
27+
.ShardSize(100)
28+
)
29+
----
30+
31+
==== Object Initializer syntax example
32+
33+
[source,csharp]
34+
----
35+
new GeoTileGridAggregation("my_geotile")
36+
{
37+
Field = Field<Project>(p => p.LocationPoint),
38+
Precision = GeoTilePrecision.Precision3,
39+
Size = 1000,
40+
ShardSize = 100
41+
}
42+
----
43+
44+
[source,javascript]
45+
.Example json output
46+
----
47+
{
48+
"my_geotile": {
49+
"geotile_grid": {
50+
"field": "locationPoint",
51+
"precision": 3,
52+
"size": 1000,
53+
"shard_size": 100
54+
}
55+
}
56+
}
57+
----
58+
59+
==== Handling Responses
60+
61+
[source,csharp]
62+
----
63+
response.ShouldBeValid();
64+
var myGeoTileGrid = response.Aggregations.GeoTile("my_geotile");
65+
myGeoTileGrid.Should().NotBeNull();
66+
var firstBucket = myGeoTileGrid.Buckets.First();
67+
firstBucket.Key.Should().NotBeNullOrWhiteSpace();
68+
firstBucket.DocCount.Should().BeGreaterThan(0);
69+
----
70+

docs/aggregations/bucket/parent/parent-aggregation-usage.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ new ParentAggregation("name_of_parent_agg", typeof(CommitActivity)) <1>
4747
}
4848
----
4949
<1> `join` field is determined from the _child_ type. In this example, it is `CommitActivity`
50-
5150
<2> sub-aggregations are on the type determined from the `join` field. In this example, a `Project` is a parent of `CommitActivity`
5251

5352
[source,javascript]

docs/aggregations/writing-aggregations.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ return s => s
232232
);
233233
----
234234
<1> a list of aggregation functions to apply
235-
236235
<2> Using LINQ's `Aggregate()` function to accumulate/apply all of the aggregation functions
237236

238237
[[handling-aggregate-response]]
@@ -276,6 +275,5 @@ var maxPerChild = childAggregation.Max("max_per_child");
276275
maxPerChild.Should().NotBeNull(); <2>
277276
----
278277
<1> Do something with the average per child. Here we just assert it's not null
279-
280278
<2> Do something with the max per child. Here we just assert it's not null
281279

docs/client-concepts/connection-pooling/exceptions/unexpected-exceptions.asciidoc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ audit = await audit.TraceUnexpectedException(
5858
);
5959
----
6060
<1> set up a cluster with 10 nodes
61-
6261
<2> where node 2 on port 9201 always throws an exception
63-
6462
<3> The first call to 9200 returns a healthy response
65-
6663
<4> ...but the second call, to 9201, returns a bad response
6764

6865
Sometimes, an unexpected exception happens further down in the pipeline. In this scenario, we
@@ -97,9 +94,7 @@ audit = await audit.TraceUnexpectedException(
9794
);
9895
----
9996
<1> calls on 9200 set up to throw a `HttpRequestException`
100-
10197
<2> calls on 9201 set up to throw an `Exception`
102-
10398
<3> Assert that the audit trail for the client call includes the bad response from 9200 and 9201
10499

105100
An unexpected hard exception on ping and sniff is something we *do* try to recover from and failover to retrying on the next node.
@@ -144,8 +139,6 @@ audit = await audit.TraceUnexpectedException(
144139
);
145140
----
146141
<1> `InnerException` is the exception that brought the request down
147-
148142
<2> The hard exception that happened on ping is still available though
149-
150143
<3> An exception can be hard to relate back to a point in time, so the exception is also available on the audit trail
151144

docs/client-concepts/connection-pooling/exceptions/unrecoverable-exceptions.asciidoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ var audit = new Auditor(() => VirtualClusterWith
8181
);
8282
----
8383
<1> Always succeed on ping
84-
8584
<2> ...but always fail on calls with a 401 Bad Authentication response
8685

8786
Now, let's make a client call. We'll see that the first audit event is a successful ping
@@ -102,9 +101,7 @@ audit = await audit.TraceElasticsearchException(
102101
);
103102
----
104103
<1> First call results in a successful ping
105-
106104
<2> Second call results in a bad response
107-
108105
<3> The reason for the bad response is Bad Authentication
109106

110107
When a bad authentication response occurs, the client attempts to deserialize the response body returned;
@@ -138,7 +135,6 @@ audit = await audit.TraceElasticsearchException(
138135
);
139136
----
140137
<1> Always return a 401 bad response with a HTML response on client calls
141-
142138
<2> Assert that the response body bytes are null
143139

144140
Now in this example, by turning on `DisableDirectStreaming()` on `ConnectionSettings`, we see the same behaviour exhibited
@@ -173,6 +169,5 @@ audit = await audit.TraceElasticsearchException(
173169
);
174170
----
175171
<1> Response bytes are set on the response
176-
177172
<2> Assert that the response contains `"nginx/"`
178173

docs/client-concepts/connection-pooling/request-overrides/disable-sniff-ping-per-request.asciidoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,8 @@ audit = await audit.TraceCalls(
6565
);
6666
----
6767
<1> disable sniffing
68-
6968
<2> first call is a successful ping
70-
7169
<3> sniff on startup call happens here, on the second call
72-
7370
<4> No sniff on startup again
7471

7572
Now, let's disable pinging on the request
@@ -93,7 +90,6 @@ audit = await audit.TraceCall(
9390
);
9491
----
9592
<1> disable ping
96-
9793
<2> No ping after sniffing
9894

9995
Finally, let's demonstrate disabling both sniff and ping on the request
@@ -115,6 +111,5 @@ audit = await audit.TraceCall(
115111
);
116112
----
117113
<1> diable ping and sniff
118-
119114
<2> no ping or sniff before the call
120115

docs/client-concepts/connection-pooling/round-robin/skip-dead-nodes.asciidoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ await audit.TraceCalls(
140140
);
141141
----
142142
<1> The first call goes to 9200 which succeeds
143-
144143
<2> The 2nd call does a ping on 9201 because its used for the first time. It fails so we wrap over to node 9202
145-
146144
<3> The next call goes to 9203 which fails so we should wrap over
147145

148146
A cluster with 2 nodes where the second node fails on ping
@@ -193,6 +191,5 @@ await audit.TraceCalls(
193191
);
194192
----
195193
<1> All the calls fail
196-
197194
<2> After all our registered nodes are marked dead we want to sample a single dead node each time to quickly see if the cluster is back up. We do not want to retry all 4 nodes
198195

docs/client-concepts/connection-pooling/sniffing/role-detection.asciidoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ var audit = new Auditor(() => VirtualClusterWith
138138
};
139139
----
140140
<1> Before the sniff, assert we only see three master only nodes
141-
142141
<2> After the sniff, assert we now know about the existence of 20 nodes.
143142

144143
After the sniff has happened on 9200 before the first API call, assert that the subsequent API
@@ -219,9 +218,7 @@ var audit = new Auditor(() => VirtualClusterWith
219218
};
220219
----
221220
<1> for testing simplicity, disable pings
222-
223221
<2> We only want to execute API calls to nodes in rack_one
224-
225222
<3> After sniffing on startup, assert that the pool of nodes that the client will execute API calls against only contains the three nodes that are in `rack_one`
226223

227224
With the cluster set up, assert that the sniff happens on 9200 before the first API call
@@ -298,8 +295,6 @@ await audit.TraceUnexpectedElasticsearchException(new ClientCall
298295
});
299296
----
300297
<1> The audit trail indicates a sniff for the very first time on startup
301-
302298
<2> The sniff succeeds because the node predicate is ignored when sniffing
303-
304299
<3> when trying to do an actual API call however, the predicate prevents any nodes from being attempted
305300

docs/client-concepts/connection/configuration-options.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ Instead of following a c/go like error checking on response.IsValid do throw an
190190
+
191191
Reasons for such exceptions could be search parser errors, index missing exceptions, etc...
192192

193+
`UserAgent`::
194+
195+
The user agent string to send with requests. Useful for debugging purposes to understand client and framework versions that initiate requests to Elasticsearch
196+
193197
:xml-docs: Elasticsearch.Net:ConnectionConfiguration`1
194198

195199
==== ConnectionConfiguration with ElasticLowLevelClient

0 commit comments

Comments
 (0)