Skip to content

Commit 0832b32

Browse files
committed
rename ElasticInferrer to Inferrer
1 parent 35b0bed commit 0832b32

File tree

20 files changed

+547
-691
lines changed

20 files changed

+547
-691
lines changed

src/Nest/CommonAbstractions/ConnectionSettings/ConnectionSettings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public abstract class ConnectionSettings<TConnectionSettings> : ConnectionConfig
4242
private string _defaultIndex;
4343
string IConnectionSettingsValues.DefaultIndex => this._defaultIndex;
4444

45-
private readonly ElasticInferrer _inferrer;
46-
ElasticInferrer IConnectionSettingsValues.Inferrer => _inferrer;
45+
private readonly Inferrer _inferrer;
46+
Inferrer IConnectionSettingsValues.Inferrer => _inferrer;
4747

4848
private Func<Type, string> _defaultTypeNameInferrer;
4949
Func<Type, string> IConnectionSettingsValues.DefaultTypeNameInferrer => _defaultTypeNameInferrer;
@@ -71,7 +71,7 @@ protected ConnectionSettings(IConnectionPool connectionPool, IConnection connect
7171
this._defaultIndices = new FluentDictionary<Type, string>();
7272
this._defaultTypeNames = new FluentDictionary<Type, string>();
7373

74-
this._inferrer = new ElasticInferrer(this);
74+
this._inferrer = new Inferrer(this);
7575
}
7676

7777
/// <summary>

src/Nest/CommonAbstractions/ConnectionSettings/IConnectionSettingsValues.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Nest
88
{
99
public interface IConnectionSettingsValues : IConnectionConfigurationValues
1010
{
11-
ElasticInferrer Inferrer { get; }
11+
Inferrer Inferrer { get; }
1212
FluentDictionary<Type, string> DefaultIndices { get; }
1313
FluentDictionary<Type, string> DefaultTypeNames { get; }
1414
FluentDictionary<Type, string> IdProperties { get; }

src/Nest/CommonAbstractions/Fields/FieldValues.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ namespace Nest
1313
[JsonConverter(typeof(FieldValuesJsonConverter))]
1414
public class FieldValues : IsADictionary<string, object>
1515
{
16-
private ElasticInferrer _inferrer;
16+
private Inferrer _inferrer;
1717

18-
public FieldValues(ElasticInferrer inferrer, IDictionary<string, object> container)
18+
public FieldValues(Inferrer inferrer, IDictionary<string, object> container)
1919
: base(container)
2020
{
2121
_inferrer = inferrer;

src/Nest/CommonAbstractions/Infer/ElasticInferrer.cs

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/Nest/CommonAbstractions/Infer/Field/Field.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ string IUrlParameter.GetString(IConnectionConfigurationValues settings)
8686
var nestSettings = settings as IConnectionSettingsValues;
8787
if (nestSettings == null)
8888
throw new Exception("Tried to pass field name on querysting but it could not be resolved because no nest settings are available");
89-
var infer = new ElasticInferrer(nestSettings);
89+
var infer = new Inferrer(nestSettings);
9090
return infer.Field(this);
9191
}
9292
}

src/Nest/CommonAbstractions/Infer/Indices/Indices.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ string IUrlParameter.GetString(IConnectionConfigurationValues settings)
5757
var nestSettings = settings as IConnectionSettingsValues;
5858
if (nestSettings == null)
5959
throw new Exception("Tried to pass field name on querysting but it could not be resolved because no nest settings are available");
60-
var infer = new ElasticInferrer(nestSettings);
60+
var infer = new Inferrer(nestSettings);
6161
var indices = many.Indices.Select(i => infer.IndexName(i)).Distinct();
6262
return string.Join(",", indices);
6363
}

src/Nest/CommonAbstractions/Infer/PropertyName/PropertyName.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ string IUrlParameter.GetString(IConnectionConfigurationValues settings)
7676
var nestSettings = settings as IConnectionSettingsValues;
7777
if (nestSettings == null)
7878
throw new Exception("Tried to pass field name on querysting but it could not be resolved because no nest settings are available");
79-
var infer = new ElasticInferrer(nestSettings);
79+
var infer = new Inferrer(nestSettings);
8080
return infer.PropertyName(this);
8181
}
8282
}

src/Nest/CommonAbstractions/Infer/PropertyName/PropertyNameJsonConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
1919
writer.WriteNull();
2020
return;
2121
}
22-
writer.WriteValue(new ElasticInferrer(serializer.GetConnectionSettings()).PropertyName(property));
22+
writer.WriteValue(new Inferrer(serializer.GetConnectionSettings()).PropertyName(property));
2323
}
2424
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
2525
{

src/Nest/CommonAbstractions/Infer/Types/Types.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ string IUrlParameter.GetString(IConnectionConfigurationValues settings)
5757
var nestSettings = settings as IConnectionSettingsValues;
5858
if (nestSettings == null)
5959
throw new Exception("Tried to pass field name on querysting but it could not be resolved because no nest settings are available");
60-
var infer = new ElasticInferrer(nestSettings);
60+
var infer = new Inferrer(nestSettings);
6161
var types = this.Item2.Types.Select(t => infer.TypeName(t)).Distinct();
6262
return string.Join(",", types);
6363
}
Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
using System;
2-
3-
namespace Nest
4-
{
5-
public interface IBulkCreateOperation<T> : IBulkOperation
6-
where T : class
7-
{
8-
T Document { get; set; }
9-
}
10-
11-
public class BulkCreateOperation<T> : BulkOperationBase, IBulkCreateOperation<T>
12-
where T : class
13-
{
1+
using System;
2+
3+
namespace Nest
4+
{
5+
public interface IBulkCreateOperation<T> : IBulkOperation
6+
where T : class
7+
{
8+
T Document { get; set; }
9+
}
10+
11+
public class BulkCreateOperation<T> : BulkOperationBase, IBulkCreateOperation<T>
12+
where T : class
13+
{
1414
public T Document { get; set; }
1515

16-
public BulkCreateOperation(T document)
17-
{
18-
this.Document = document;
19-
}
20-
21-
protected override string Operation => "create";
22-
23-
protected override Type ClrType => typeof(T);
24-
25-
protected override object GetBody() => this.Document;
26-
27-
protected override Id GetIdForOperation(ElasticInferrer inferrer) => this.Id ?? new Id(this.Document);
28-
}
29-
30-
31-
public class BulkCreateDescriptor<T> : BulkOperationDescriptorBase<BulkCreateDescriptor<T>, IBulkCreateOperation<T>>, IBulkCreateOperation<T>
32-
where T : class
33-
{
34-
protected override string BulkOperationType => "create";
35-
protected override Type BulkOperationClrType => typeof(T);
36-
37-
protected override object GetBulkOperationBody() => Self.Document;
38-
39-
protected override Id GetIdForOperation(ElasticInferrer inferrer) => Self.Id ?? new Id(Self.Document);
40-
16+
public BulkCreateOperation(T document)
17+
{
18+
this.Document = document;
19+
}
20+
21+
protected override string Operation => "create";
22+
23+
protected override Type ClrType => typeof(T);
24+
25+
protected override object GetBody() => this.Document;
26+
27+
protected override Id GetIdForOperation(Inferrer inferrer) => this.Id ?? new Id(this.Document);
28+
}
29+
30+
31+
public class BulkCreateDescriptor<T> : BulkOperationDescriptorBase<BulkCreateDescriptor<T>, IBulkCreateOperation<T>>, IBulkCreateOperation<T>
32+
where T : class
33+
{
34+
protected override string BulkOperationType => "create";
35+
protected override Type BulkOperationClrType => typeof(T);
36+
37+
protected override object GetBulkOperationBody() => Self.Document;
38+
39+
protected override Id GetIdForOperation(Inferrer inferrer) => Self.Id ?? new Id(Self.Document);
40+
4141
T IBulkCreateOperation<T>.Document { get; set; }
4242

43-
/// <summary>
44-
/// The object to update, if id is not manually set it will be inferred from the object
45-
/// </summary>
43+
/// <summary>
44+
/// The object to update, if id is not manually set it will be inferred from the object
45+
/// </summary>
4646
public BulkCreateDescriptor<T> Document(T @object) => Assign(a => a.Document = @object);
47-
}
47+
}
4848
}

0 commit comments

Comments
 (0)