Skip to content

Commit 19f5cdf

Browse files
committed
Cleans up Elasticsearch alias handling
Removes unnecessary workaround for Elasticsearch-net issue. The workaround is no longer needed and simplifies the alias retrieval logic. Adds a list initialization for clarity.
1 parent 742bb01 commit 19f5cdf

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

tests/Foundatio.Repositories.Elasticsearch.Tests/Extensions/ElasticsearchExtensions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public static async Task AssertSingleIndexAlias(this IElasticClient client, stri
2121
public static async Task<int> GetAliasIndexCount(this IElasticClient client, string aliasName)
2222
{
2323
var response = await client.Indices.GetAliasAsync(aliasName, a => a.IgnoreUnavailable());
24-
// TODO: Fix this properly once https://github.com/elastic/elasticsearch-net/issues/3828 is fixed in beta2
25-
if (!response.IsValid)
26-
return 0;
27-
2824
if (!response.IsValid && response.ServerError?.Status == 404)
2925
return 0;
3026

tests/Foundatio.Repositories.Elasticsearch.Tests/QueryableReadOnlyRepositoryTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public async Task SearchByQueryWithIncludesAnAliases()
105105
[Fact]
106106
public async Task SearchByAnalyzedTextFieldAsync()
107107
{
108-
await _employeeRepository.AddAsync(new List<Employee> {
108+
await _employeeRepository.AddAsync(new List<Employee>
109+
{
109110
EmployeeGenerator.Generate(age: 19, name: "Blake Niemyjski")
110111
}, o => o.ImmediateConsistency());
111112

0 commit comments

Comments
 (0)