Skip to content

File contents was switched for GeoPoint and GeoShape mapping descriptors #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions src/Nest/Domain/Mapping/Descriptors/GeoPointMappingDescriptor.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
using System;
using System.Linq.Expressions;
using Nest.Resolvers;

namespace Nest
{
public class GeoShapeMappingDescriptor<T>
public class GeoPointMappingDescriptor<T>
{
internal GeoShapeMapping _Mapping = new GeoShapeMapping();
internal GeoPointMapping _Mapping = new GeoPointMapping();

public GeoShapeMappingDescriptor<T> Name(string name)
public GeoPointMappingDescriptor<T> Name(string name)
{
this._Mapping.Name = name;
return this;
}
public GeoShapeMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
public GeoPointMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
{
this._Mapping.Name = objectPath;
return this;
}

public GeoShapeMappingDescriptor<T> Tree(GeoTree geoTree)
public GeoPointMappingDescriptor<T> IndexLatLon(bool indexLatLon = true)
{
this._Mapping.Tree = geoTree;
this._Mapping.IndexLatLon = indexLatLon;
return this;
}

public GeoShapeMappingDescriptor<T> TreeLevels(int treeLevels)
public GeoPointMappingDescriptor<T> IndexGeoHash(bool indexGeoHash = true)
{
this._Mapping.TreeLevels = treeLevels;
this._Mapping.IndexGeoHash = indexGeoHash;
return this;
}

public GeoShapeMappingDescriptor<T> DistanceErrorPercentage(double distanceErrorPercentage)
public GeoPointMappingDescriptor<T> GeoHashPrecision(int geoHashPrecision)
{
this._Mapping.DistanceErrorPercentage = distanceErrorPercentage;
this._Mapping.GeoHashPrecision = geoHashPrecision;
return this;
}


}
}
24 changes: 10 additions & 14 deletions src/Nest/Domain/Mapping/Descriptors/GeoShapeMappingDescriptor.cs
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
using System;
using System.Linq.Expressions;
using Nest.Resolvers;

namespace Nest
{
public class GeoPointMappingDescriptor<T>
public class GeoShapeMappingDescriptor<T>
{
internal GeoPointMapping _Mapping = new GeoPointMapping();
internal GeoShapeMapping _Mapping = new GeoShapeMapping();

public GeoPointMappingDescriptor<T> Name(string name)
public GeoShapeMappingDescriptor<T> Name(string name)
{
this._Mapping.Name = name;
return this;
}
public GeoPointMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
public GeoShapeMappingDescriptor<T> Name(Expression<Func<T, object>> objectPath)
{
this._Mapping.Name = objectPath;
return this;
}


public GeoPointMappingDescriptor<T> IndexLatLon(bool indexLatLon = true)
public GeoShapeMappingDescriptor<T> Tree(GeoTree geoTree)
{
this._Mapping.IndexLatLon = indexLatLon;
this._Mapping.Tree = geoTree;
return this;
}

public GeoPointMappingDescriptor<T> IndexGeoHash(bool indexGeoHash = true)
public GeoShapeMappingDescriptor<T> TreeLevels(int treeLevels)
{
this._Mapping.IndexGeoHash = indexGeoHash;
this._Mapping.TreeLevels = treeLevels;
return this;
}

public GeoPointMappingDescriptor<T> GeoHashPrecision(int geoHashPrecision)
public GeoShapeMappingDescriptor<T> DistanceErrorPercentage(double distanceErrorPercentage)
{
this._Mapping.GeoHashPrecision = geoHashPrecision;
this._Mapping.DistanceErrorPercentage = distanceErrorPercentage;
return this;
}


}
}