Skip to content

Commit 54b1ed1

Browse files
committed
Fix compiler warnings (#3729)
1 parent 565374e commit 54b1ed1

File tree

5 files changed

+17
-23
lines changed

5 files changed

+17
-23
lines changed

docs/client-concepts/high-level/indexing/indexing-documents.asciidoc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////
88
IMPORTANT NOTE
99
==============
10-
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/feature/improve-docs/src/Tests/Tests/ClientConcepts/HighLevel/Indexing/Indexing.doc.cs.
10+
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/6.x/src/Tests/Tests/ClientConcepts/HighLevel/Indexing/IndexingDocuments.doc.cs.
1111
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,
1212
please modify the original csharp file found at the link and submit the PR with that change. Thanks!
1313
////
@@ -205,12 +205,7 @@ client.BulkAll(people, b => b
205205
})
206206
.RetryDocumentPredicate((item, person) => <3>
207207
{
208-
if (item.Error.Index == "even-index"
209-
&& person.FirstName == "Martijn")
210-
{
211-
return true;
212-
}
213-
return false;
208+
return item.Error.Index == "even-index" && person.FirstName == "Martijn";
214209
})
215210
.DroppedDocumentCallback((item, person) => <4>
216211
{

docs/client-concepts/high-level/indexing/pipelines.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ please modify the original csharp file found at the link and submit the PR with
1717

1818
An ingest pipeline is a series of processors that are to be executed in the same order as they are declared.
1919

20+
Let's work with the following POCOs
21+
2022
[source,csharp]
2123
----
2224
public class Person

src/Tests/Tests/ClientConcepts/HighLevel/Indexing/IndexingDocuments.doc.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public async Task SingleDocument()
5353
* If you need to set additional parameters when indexing you can use the fluent or object initializer syntax.
5454
* This will allow you finer control over the indexing of single documents.
5555
*/
56-
public async Task SingleDocumentWithParameters()
56+
public void SingleDocumentWithParameters()
5757
{
5858
var person = new Person
5959
{
@@ -154,7 +154,7 @@ public async Task BulkIndexDocuments()
154154
*
155155
* The helper will also lazily enumerate an `IEnumerable<T>` collection, allowing you to index a large number of documents easily.
156156
*/
157-
public async Task BulkDocumentsWithObservableHelper()
157+
public void BulkDocumentsWithObservableHelper()
158158
{
159159
// hide
160160
var people = new []
@@ -203,7 +203,7 @@ public async Task BulkDocumentsWithObservableHelper()
203203
* 2. `RetryDocumentPredicate` enables fine control on deciding if a document that failed to be indexed should be retried.
204204
* 3. `DroppedDocumentCallback` in the event a document is not indexed, even after retrying, this delegate is called.
205205
*/
206-
public async Task AdvancedBulkIndexing()
206+
public void AdvancedBulkIndexing()
207207
{
208208
//hide
209209
var people = new[] { new Person() };
@@ -221,12 +221,7 @@ public async Task AdvancedBulkIndexing()
221221
})
222222
.RetryDocumentPredicate((item, person) => //<3> decide if a document should be retried in the event of a failure
223223
{
224-
if (item.Error.Index == "even-index"
225-
&& person.FirstName == "Martijn")
226-
{
227-
return true;
228-
}
229-
return false;
224+
return item.Error.Index == "even-index" && person.FirstName == "Martijn";
230225
})
231226
.DroppedDocumentCallback((item, person) => //<4> if a document cannot be indexed this delegate is called
232227
{

src/Tests/Tests/ClientConcepts/HighLevel/Indexing/IngestNodes.doc.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class IngestNodes : DocumentationTestBase
2626
*
2727
* The simplest way to achieve this is to create a dedicated "indexing" client instance, and use it for indexing requests.
2828
*/
29-
public async Task CustomClient()
29+
public void CustomClient()
3030
{
3131
var pool = new StaticConnectionPool(new [] //<1> list of ingest nodes
3232
{
@@ -45,7 +45,7 @@ public async Task CustomClient()
4545
* filter out the nodes that have ingest capabilities. This allows you to customise the cluster and not have to reconfigure
4646
* the client.
4747
*/
48-
public async Task SniffingConnectionPool()
48+
public void SniffingConnectionPool()
4949
{
5050
var pool = new SniffingConnectionPool(new [] //<1> list of cluster nodes
5151
{

src/Tests/Tests/ClientConcepts/HighLevel/Indexing/Pipelines.doc.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
namespace Tests.ClientConcepts.HighLevel.Caching
99
{
1010
/**[[pipelines]]
11-
*=== Ingest Pipelines
12-
*
13-
* An ingest pipeline is a series of processors that are to be executed in the same order as they are declared.
11+
*=== Ingest Pipelines
12+
*
13+
* An ingest pipeline is a series of processors that are to be executed in the same order as they are declared.
14+
*
15+
* Let's work with the following POCOs
1416
*/
1517
public class IngestPipelines : DocumentationTestBase
1618
{
@@ -46,7 +48,7 @@ public class GeoIp
4648
* We could achieve this requirement by creating a custom mapping and creating an ingest pipeline.
4749
* The Person type can then be used as-is, without making any changes.
4850
*/
49-
public async Task IngestionPipeline()
51+
public void IngestionPipeline()
5052
{
5153
client.CreateIndex("people", c => c
5254
.Mappings(ms => ms
@@ -95,7 +97,7 @@ public async Task IngestionPipeline()
9597
*
9698
* For large bulk requests, it could be prudent to increase the default indexing timeout to avoid exceptions.
9799
*/
98-
public async Task IncreasingTimeouts()
100+
public void IncreasingTimeouts()
99101
{
100102
client.Bulk(b => b
101103
.Index("people")

0 commit comments

Comments
 (0)