Skip to content

Commit a7b9dc7

Browse files
committed
Merge pull request #774 from andersosthus/mappingfix
File contents was switched for GeoPoint and GeoShape mapping descriptors
2 parents 2f426c9 + a481bbe commit a7b9dc7

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,39 @@
11
using System;
22
using System.Linq.Expressions;
3-
using Nest.Resolvers;
43

54
namespace Nest
65
{
7-
public class GeoShapeMappingDescriptor<T>
6+
public class GeoPointMappingDescriptor<T>
87
{
9-
internal GeoShapeMapping _Mapping = new GeoShapeMapping();
8+
internal GeoPointMapping _Mapping = new GeoPointMapping();
109

11-
public GeoShapeMappingDescriptor<T> Name(string name)
10+
public GeoPointMappingDescriptor<T> Name(string name)
1211
{
1312
this._Mapping.Name = name;
1413
return this;
1514
}
16-
public GeoShapeMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
15+
public GeoPointMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
1716
{
1817
this._Mapping.Name = objectPath;
1918
return this;
2019
}
2120

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

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

34-
public GeoShapeMappingDescriptor<T> DistanceErrorPercentage(double distanceErrorPercentage)
33+
public GeoPointMappingDescriptor<T> GeoHashPrecision(int geoHashPrecision)
3534
{
36-
this._Mapping.DistanceErrorPercentage = distanceErrorPercentage;
35+
this._Mapping.GeoHashPrecision = geoHashPrecision;
3736
return this;
3837
}
39-
40-
4138
}
4239
}
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
11
using System;
22
using System.Linq.Expressions;
3-
using Nest.Resolvers;
43

54
namespace Nest
65
{
7-
public class GeoPointMappingDescriptor<T>
6+
public class GeoShapeMappingDescriptor<T>
87
{
9-
internal GeoPointMapping _Mapping = new GeoPointMapping();
8+
internal GeoShapeMapping _Mapping = new GeoShapeMapping();
109

11-
public GeoPointMappingDescriptor<T> Name(string name)
10+
public GeoShapeMappingDescriptor<T> Name(string name)
1211
{
1312
this._Mapping.Name = name;
1413
return this;
1514
}
16-
public GeoPointMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
15+
public GeoShapeMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
1716
{
1817
this._Mapping.Name = objectPath;
1918
return this;
2019
}
2120

22-
23-
public GeoPointMappingDescriptor<T> IndexLatLon(bool indexLatLon = true)
21+
public GeoShapeMappingDescriptor<T> Tree(GeoTree geoTree)
2422
{
25-
this._Mapping.IndexLatLon = indexLatLon;
23+
this._Mapping.Tree = geoTree;
2624
return this;
2725
}
2826

29-
public GeoPointMappingDescriptor<T> IndexGeoHash(bool indexGeoHash = true)
27+
public GeoShapeMappingDescriptor<T> TreeLevels(int treeLevels)
3028
{
31-
this._Mapping.IndexGeoHash = indexGeoHash;
29+
this._Mapping.TreeLevels = treeLevels;
3230
return this;
3331
}
3432

35-
public GeoPointMappingDescriptor<T> GeoHashPrecision(int geoHashPrecision)
33+
public GeoShapeMappingDescriptor<T> DistanceErrorPercentage(double distanceErrorPercentage)
3634
{
37-
this._Mapping.GeoHashPrecision = geoHashPrecision;
35+
this._Mapping.DistanceErrorPercentage = distanceErrorPercentage;
3836
return this;
3937
}
40-
41-
4238
}
4339
}

0 commit comments

Comments
 (0)