Skip to content

Commit 0daa4a9

Browse files
committed
fix #372 do not touch DefaultIndex if its not neccessary while resolving index name
1 parent c653b91 commit 0daa4a9

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Collections.Concurrent;
6-
using System.Reflection;
7-
8-
namespace Nest.Resolvers
9-
{
10-
public class IndexNameResolver
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Collections.Concurrent;
6+
using System.Reflection;
7+
8+
namespace Nest.Resolvers
9+
{
10+
public class IndexNameResolver
1111
{
1212
private readonly IConnectionSettings _connectionSettings;
1313

@@ -25,14 +25,13 @@ public string GetIndexForType<T>()
2525
public string GetIndexForType(Type type)
2626
{
2727
var defaultIndices = this._connectionSettings.DefaultIndices;
28-
var defaultIndex = this._connectionSettings.DefaultIndex;
2928

3029
if (defaultIndices == null)
31-
return defaultIndex;
30+
return this._connectionSettings.DefaultIndex;
3231
if (defaultIndices.ContainsKey(type) && !string.IsNullOrWhiteSpace(defaultIndices[type]))
3332
return defaultIndices[type];
34-
return defaultIndex;
35-
}
36-
37-
}
38-
}
33+
return this._connectionSettings.DefaultIndex;
34+
}
35+
36+
}
37+
}

0 commit comments

Comments
 (0)