Skip to content

Commit 5b0ab0f

Browse files
committed
Merge branch 'develop' into feature/unused-usings
2 parents 78e8e1d + ff3d3d7 commit 5b0ab0f

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

src/Nest/Domain/Mapping/Descriptors/GeoPointMappingDescriptor.cs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,37 @@
33

44
namespace Nest
55
{
6-
public class GeoShapeMappingDescriptor<T>
6+
public class GeoPointMappingDescriptor<T>
77
{
8-
internal GeoShapeMapping _Mapping = new GeoShapeMapping();
8+
internal GeoPointMapping _Mapping = new GeoPointMapping();
99

10-
public GeoShapeMappingDescriptor<T> Name(string name)
10+
public GeoPointMappingDescriptor<T> Name(string name)
1111
{
1212
this._Mapping.Name = name;
1313
return this;
1414
}
15-
public GeoShapeMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
15+
public GeoPointMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
1616
{
1717
this._Mapping.Name = objectPath;
1818
return this;
1919
}
2020

21-
public GeoShapeMappingDescriptor<T> Tree(GeoTree geoTree)
21+
public GeoPointMappingDescriptor<T> IndexLatLon(bool indexLatLon = true)
2222
{
23-
this._Mapping.Tree = geoTree;
23+
this._Mapping.IndexLatLon = indexLatLon;
2424
return this;
2525
}
2626

27-
public GeoShapeMappingDescriptor<T> TreeLevels(int treeLevels)
27+
public GeoPointMappingDescriptor<T> IndexGeoHash(bool indexGeoHash = true)
2828
{
29-
this._Mapping.TreeLevels = treeLevels;
29+
this._Mapping.IndexGeoHash = indexGeoHash;
3030
return this;
3131
}
3232

33-
public GeoShapeMappingDescriptor<T> DistanceErrorPercentage(double distanceErrorPercentage)
33+
public GeoPointMappingDescriptor<T> GeoHashPrecision(int geoHashPrecision)
3434
{
35-
this._Mapping.DistanceErrorPercentage = distanceErrorPercentage;
35+
this._Mapping.GeoHashPrecision = geoHashPrecision;
3636
return this;
3737
}
38-
39-
4038
}
4139
}

src/Nest/Domain/Mapping/Descriptors/GeoShapeMappingDescriptor.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,37 @@
33

44
namespace Nest
55
{
6-
public class GeoPointMappingDescriptor<T>
6+
public class GeoShapeMappingDescriptor<T>
77
{
8-
internal GeoPointMapping _Mapping = new GeoPointMapping();
8+
internal GeoShapeMapping _Mapping = new GeoShapeMapping();
99

10-
public GeoPointMappingDescriptor<T> Name(string name)
10+
public GeoShapeMappingDescriptor<T> Name(string name)
1111
{
1212
this._Mapping.Name = name;
1313
return this;
1414
}
15-
public GeoPointMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
15+
public GeoShapeMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
1616
{
1717
this._Mapping.Name = objectPath;
1818
return this;
1919
}
2020

21-
22-
public GeoPointMappingDescriptor<T> IndexLatLon(bool indexLatLon = true)
21+
public GeoShapeMappingDescriptor<T> Tree(GeoTree geoTree)
2322
{
24-
this._Mapping.IndexLatLon = indexLatLon;
23+
this._Mapping.Tree = geoTree;
2524
return this;
2625
}
2726

28-
public GeoPointMappingDescriptor<T> IndexGeoHash(bool indexGeoHash = true)
27+
public GeoShapeMappingDescriptor<T> TreeLevels(int treeLevels)
2928
{
30-
this._Mapping.IndexGeoHash = indexGeoHash;
29+
this._Mapping.TreeLevels = treeLevels;
3130
return this;
3231
}
3332

34-
public GeoPointMappingDescriptor<T> GeoHashPrecision(int geoHashPrecision)
33+
public GeoShapeMappingDescriptor<T> DistanceErrorPercentage(double distanceErrorPercentage)
3534
{
36-
this._Mapping.GeoHashPrecision = geoHashPrecision;
35+
this._Mapping.DistanceErrorPercentage = distanceErrorPercentage;
3736
return this;
3837
}
39-
40-
4138
}
4239
}

src/Nest/Extensions/Extensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45
using System.Runtime.Serialization;
56
using System.Text;
@@ -91,10 +92,12 @@ internal static void ThrowIfNull<T>(this T value, string name)
9192
if (value == null)
9293
throw new ArgumentNullException(name);
9394
}
95+
9496
internal static string F(this string format, params object[] args)
9597
{
98+
var c = CultureInfo.InvariantCulture;
9699
format.ThrowIfNull("format");
97-
return string.Format(format, args);
100+
return string.Format(c, format, args);
98101
}
99102
internal static string EscapedFormat(this string format, params object[] args)
100103
{

src/Nest/Resolvers/Converters/Filters/GeoBoundingFilterConverter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45
using Newtonsoft.Json;
56
using Newtonsoft.Json.Linq;
@@ -100,6 +101,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
100101

101102
private void ReadBox(IGeoBoundingBoxFilter filter, JsonReader reader)
102103
{
104+
var c = CultureInfo.InvariantCulture;
103105
reader.Read();
104106
if (reader.TokenType != JsonToken.StartObject)
105107
return;
@@ -118,11 +120,11 @@ private void ReadBox(IGeoBoundingBoxFilter filter, JsonReader reader)
118120
else if (reader.TokenType == JsonToken.StartArray)
119121
{
120122
var values = JArray.Load(reader).Values<double>();
121-
filter.TopLeft = string.Join(", ", values);
123+
filter.TopLeft = string.Join(", ", values.Select(v=>v.ToString(c)));
122124
reader.Read();
123125
reader.Read();
124126
values = JArray.Load(reader).Values<double>();
125-
filter.BottomRight =string.Join(", ", values);
127+
filter.BottomRight =string.Join(", ", values.Select(v=>v.ToString(c)));
126128
}
127129
else if (reader.TokenType == JsonToken.StartObject)
128130
{

0 commit comments

Comments
 (0)