Skip to content

Commit bafe678

Browse files
committed
More 9 work
1 parent 62cb72e commit bafe678

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Foundatio.Parsers.ElasticQueries/ElasticMappingResolver.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ public static ElasticMappingResolver Create<T>(Func<TypeMappingDescriptor<T>, Ty
502502
logger.LogTrace("GetMapping: {Request}", response.GetRequest(false, true));
503503

504504
// use first returned mapping because index could have been an index alias
505-
var mapping = response.Mappings.FirstOrDefault().Value?.Mappings;
505+
var mapping = response.Mappings.Values.FirstOrDefault()?.Mappings;
506506
return mapping;
507507
}, logger);
508508
}
@@ -518,7 +518,7 @@ public static ElasticMappingResolver Create<T>(Func<TypeMappingDescriptor<T>, Ty
518518
logger.LogTrace("GetMapping: {Request}", response.GetRequest(false, true));
519519

520520
// use first returned mapping because index could have been an index alias
521-
var mapping = response.Mappings.FirstOrDefault().Value?.Mappings;
521+
var mapping = response.Mappings.Values.FirstOrDefault()?.Mappings;
522522
return mapping;
523523
}, logger);
524524
}
@@ -540,7 +540,7 @@ public static ElasticMappingResolver Create<T>(ElasticsearchClient client, ILogg
540540
logger.LogTrace("GetMapping: {Request}", response.GetRequest(false, true));
541541

542542
// use first returned mapping because index could have been an index alias
543-
var mapping = response.Mappings.FirstOrDefault().Value?.Mappings;
543+
var mapping = response.Mappings.Values.FirstOrDefault()?.Mappings;
544544
return mapping;
545545
}, client.Infer, logger);
546546
}
@@ -556,7 +556,7 @@ public static ElasticMappingResolver Create(ElasticsearchClient client, string i
556556
logger.LogTrace("GetMapping: {Request}", response.GetRequest(false, true));
557557

558558
// use first returned mapping because index could have been an index alias
559-
var mapping = response.Mappings.FirstOrDefault().Value?.Mappings;
559+
var mapping = response.Mappings.Values.FirstOrDefault()?.Mappings;
560560
return mapping;
561561
}, client.Infer, logger);
562562
}

tests/Foundatio.Parsers.ElasticQueries.Tests/Utility/ElasticsearchTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public async Task CreateNamedIndexAsync<T>(string index, Func<TypeMappingDescrip
105105
configureMappings ??= m => m.Dynamic(DynamicMapping.True);
106106
configureIndex ??= i => i.NumberOfReplicas(0).Analysis(a => a.AddSortNormalizer());
107107

108-
await CreateIndexAsync(index, i => i.Settings(configureIndex(new IndexSettingsDescriptor())).Mappings(configureMappings));
108+
await CreateIndexAsync(index, i => i.Settings(configureIndex(new IndexSettingsDescriptor())).Mappings<T>(configureMappings));
109109
Client.ElasticsearchClientSettings.DefaultIndices[typeof(T)] = index;
110110
}
111111

@@ -115,7 +115,7 @@ public async Task<string> CreateRandomIndexAsync<T>(Func<TypeMappingDescriptor<T
115115
configureMappings ??= m => m.Dynamic(DynamicMapping.True);
116116
configureIndex ??= i => i.NumberOfReplicas(0).Analysis(a => a.AddSortNormalizer());
117117

118-
await CreateIndexAsync(index, i => i.Settings(configureIndex(new IndexSettingsDescriptor())).Mappings(configureMappings));
118+
await CreateIndexAsync(index, i => i.Settings(configureIndex(new IndexSettingsDescriptor())).Mappings<T>(configureMappings));
119119
Client.ElasticsearchClientSettings.DefaultIndices[typeof(T)] = index;
120120

121121
return index;

0 commit comments

Comments
 (0)