Skip to content

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
alkampfergit committed Jun 4, 2024
2 parents 3940f92 + 5875bdc commit ad4441f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public async Task Can_Create_index_with_mapping()
var tagmapping = (TextProperty?)tagTemplateKey.Mapping;
Assert.NotNull(tagmapping);
Assert.Equal("standard", tagmapping.Analyzer);
Assert.Equal(3, tagmapping.Fields!.Count());
Assert.Single(tagmapping.Fields!);

var nalcField = (TextProperty?) tagmapping.Fields!["na"];
Assert.NotNull(nalcField);
Assert.Equal("nalc", nalcField.Analyzer);
//var nalcField = (TextProperty?) tagmapping.Fields!["na"];
//Assert.NotNull(nalcField);
//Assert.Equal("nalc", nalcField.Analyzer);

//verify mapping of the payload properties prefixed with txt
var txtTemplate = mapping.DynamicTemplates.Single(d => d.Keys.Contains("txt"));
Expand Down
29 changes: 15 additions & 14 deletions src/KernelMemory.ElasticSearch/ElasticSearchHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ private ICollection<IDictionary<string, DynamicTemplate>> GetDynamicTemplates()
Store = true,
Fields = new Properties() {
{ "keyword", new KeywordProperty() },
{ "na", new TextProperty()
{
Analyzer = "nalc"
}
},
{ "english", new TextProperty()
{
Analyzer = "english"
}
}
//{ "na", new TextProperty()
// {

Check warning on line 119 in src/KernelMemory.ElasticSearch/ElasticSearchHelper.cs

View workflow job for this annotation

GitHub Actions / Build and analyze

Remove this commented out code. (https://rules.sonarsource.com/csharp/RSPEC-125)
// Analyzer = "nalc"
// }
//},
//{ "english", new TextProperty()
// {
// Analyzer = "english"
// }
//}
}
},
};
Expand All @@ -140,10 +140,11 @@ private ICollection<IDictionary<string, DynamicTemplate>> GetDynamicTemplates()
Index = true,
Store = true,
Fields = new Properties() {
{ "keyword", new KeywordProperty() },
//{ "keyword", new KeywordProperty() },
{ "english", new TextProperty() {
Analyzer = "english"
} }
Analyzer = "english"
}
}
}
},
};
Expand Down Expand Up @@ -228,7 +229,7 @@ internal async Task BulkIndexMemoryRecordAsync(string indexName, IEnumerable<Mem

if (bulkResponse.Errors)
{
StringBuilder errors = new ();
StringBuilder errors = new();
foreach (var itemWithError in bulkResponse.ItemsWithErrors)
{
if (itemWithError.Error == null)
Expand Down

0 comments on commit ad4441f

Please sign in to comment.