Skip to content

Commit 4e662d2

Browse files
committed
Fix tests
Bulk fluent API now must take a lambda Fix string mapping tests Fix build warnings related to unused fields
1 parent 067e1af commit 4e662d2

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

src/Nest/Document/Multiple/Bulk/ElasticClient-Bulk.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public partial interface IElasticClient
1515
IBulkResponse Bulk(IBulkRequest request);
1616

1717
/// <inheritdoc/>
18-
IBulkResponse Bulk(Func<BulkDescriptor, IBulkRequest> selector = null);
18+
IBulkResponse Bulk(Func<BulkDescriptor, IBulkRequest> selector);
1919

2020
/// <inheritdoc/>
2121
Task<IBulkResponse> BulkAsync(IBulkRequest request);
2222

2323
/// <inheritdoc/>
24-
Task<IBulkResponse> BulkAsync(Func<BulkDescriptor, IBulkRequest> selector = null);
24+
Task<IBulkResponse> BulkAsync(Func<BulkDescriptor, IBulkRequest> selector);
2525

2626
}
2727

src/Tests/Document/Multiple/Bulk/BulkUrlTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public class BulkUrlTests : IUrlTests
1111
[U] public async Task Urls()
1212
{
1313
await POST("/_bulk")
14-
.Fluent(c => c.Bulk())
14+
.Fluent(c => c.Bulk(s => s))
1515
.Request(c => c.Bulk(new BulkRequest()))
16-
.FluentAsync(c => c.BulkAsync())
16+
.FluentAsync(c => c.BulkAsync(s => s))
1717
.RequestAsync(c => c.BulkAsync(new BulkRequest()))
1818
;
1919

src/Tests/Document/Multiple/Reindex/ReindexApiTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public override void Boostrap()
2727
[Collection(IntegrationContext.Reindex)]
2828
public class ReindexApiTests : SerializationTestBase
2929
{
30-
private readonly IObservable<IReindexResponse<ILazyDocument>> _reindexManyTypesResult;
31-
private readonly IObservable<IReindexResponse<Project>> _reindexSingleTypeResult;
32-
private readonly IElasticClient _client;
30+
//private readonly IObservable<IReindexResponse<ILazyDocument>> _reindexManyTypesResult;
31+
//private readonly IObservable<IReindexResponse<Project>> _reindexSingleTypeResult;
32+
//private readonly IElasticClient _client;
3333

3434
public ReindexApiTests(ReindexCluster cluster, EndpointUsage usage)
3535
{

src/Tests/Mapping/Types/Core/String/StringMappingTests.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ public class StringTest
1414
Index = FieldIndexOption.NotAnalyzed,
1515
IndexOptions = IndexOptions.Offsets,
1616
NullValue = "na",
17-
#pragma warning disable 618
18-
// Purposely setting this obsolete property to ensure it serializes as position_increment_gap
1917
PositionIncrementGap = 5,
20-
#pragma warning restore 618
2118
SearchAnalyzer = "mysearchanalyzer",
2219
Similarity = SimilarityOption.BM25,
2320
Store = true,
@@ -61,10 +58,15 @@ public class StringMappingTests : TypeMappingTestBase<StringTest>
6158
{
6259
type = "string"
6360
},
64-
inferred = new {
61+
inferred = new
62+
{
6563
type = "text",
66-
fields = new {
67-
keyword = new { type = "keyword" }
64+
fields = new
65+
{
66+
keyword = new
67+
{
68+
type = "keyword"
69+
}
6870
}
6971
},
7072
@char = new
@@ -98,13 +100,18 @@ public class StringMappingTests : TypeMappingTestBase<StringTest>
98100
.String(s => s
99101
.Name(o => o.Minimal)
100102
)
101-
.String(s => s
103+
.Text(s => s
102104
.Name(o => o.Inferred)
105+
.Fields(f => f
106+
.Keyword(k => k
107+
.Name("keyword")
108+
)
109+
)
103110
)
104-
.String(s => s
111+
.Keyword(s => s
105112
.Name(o => o.Char)
106113
)
107-
.String(s => s
114+
.Keyword(s => s
108115
.Name(o => o.Guid)
109116
);
110117

0 commit comments

Comments
 (0)