Skip to content

Commit 245418f

Browse files
committed
Merge branch 'lukapor-master'
2 parents 0d2c1dd + 168955b commit 245418f

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/Nest/Aggregations/Bucket/DateRange/DateRangeExpression.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public class DateRangeExpressionDescriptor
3434
public DateRangeExpressionDescriptor To(DateMath to) => Assign(a => a.To = to);
3535

3636
string IDateRangeExpression.Key { get; set; }
37-
public DateRangeExpressionDescriptor From(string key) => Assign(a => a.Key = key);
37+
public DateRangeExpressionDescriptor Key(string key) => Assign(a => a.Key = key);
3838
}
3939
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ 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 Inferrer(nestSettings);
60+
61+
var infer = nestSettings.Inferrer;
6162
var indices = many.Indices.Select(i => infer.IndexName(i)).Distinct();
6263
return string.Join(",", indices);
6364
}
@@ -81,7 +82,7 @@ public override int GetHashCode()
8182
{
8283
return this.Match(
8384
all => "_all".GetHashCode(),
84-
many => string.Concat(many.Indices).GetHashCode()
85+
many => string.Concat(many.Indices.OrderBy(i => i.ToString())).GetHashCode()
8586
);
8687
}
8788
}

src/Nest/Mapping/TypeMapping.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ public TypeMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int max
173173
/// <inheritdoc/>
174174
public TypeMappingDescriptor<T> SizeField(Func<SizeFieldDescriptor, SizeFieldDescriptor> sizeFieldSelector) => Assign(a => a.SizeField = sizeFieldSelector?.Invoke(new SizeFieldDescriptor()));
175175

176-
/// <inheritdoc/>
177-
public TypeMappingDescriptor<T> DisableSizeField(bool disabled = true) => Assign(a => a.SizeField = new SizeField { Enabled = !disabled });
176+
/// <inheritdoc/>
177+
public TypeMappingDescriptor<T> SourceField(Func<SourceFieldDescriptor, SourceFieldDescriptor> sourceFieldSelector) => Assign(a => a.SourceField = sourceFieldSelector?.Invoke(new SourceFieldDescriptor()));
178+
179+
/// <inheritdoc/>
180+
public TypeMappingDescriptor<T> DisableSizeField(bool disabled = true) => Assign(a => a.SizeField = new SizeField { Enabled = !disabled });
178181

179182
/// <inheritdoc/>
180183
public TypeMappingDescriptor<T> DisableIndexField(bool disabled = true) => Assign(a => a.IndexField = new IndexField { Enabled = !disabled });

src/Nest/Search/MultiSearch/MultiSearchJsonConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
2222

2323
foreach (var operation in request.Operations.Values)
2424
{
25-
var indices = (request.Index != null && !request.Index.Equals(operation.Index))
25+
var indices = request.Index == null || !request.Index.Equals(operation.Index)
2626
? operation.Index
2727
: null;
2828

29-
var types = (request.Type != null && !request.Type.Equals(operation.Type))
29+
var types = request.Type == null || !request.Type.Equals(operation.Type)
3030
? operation.Type
3131
: null;
3232

0 commit comments

Comments
 (0)