/// <summary> /// A filter allowing to filter hits based on a point location using a bounding box /// </summary> public BaseFilter GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, double topLeftX, double topLeftY, double bottomRightX, double bottomRightY, GeoExecution?Type = null) { var c = CultureInfo.InvariantCulture; topLeftX.ThrowIfNull("topLeftX"); topLeftY.ThrowIfNull("topLeftY"); bottomRightX.ThrowIfNull("bottomRightX"); bottomRightY.ThrowIfNull("bottomRightY"); var geoHashTopLeft = "{0}, {1}".F(topLeftX.ToString(c), topLeftY.ToString(c)); var geoHashBottomRight = "{0}, {1}".F(bottomRightX.ToString(c), bottomRightY.ToString(c)); return(this.GeoBoundingBox(fieldDescriptor, geoHashTopLeft, geoHashBottomRight, Type)); }
/// <summary> /// A filter allowing to filter hits based on a point location using a bounding box /// </summary> public BaseFilter GeoBoundingBox(string fieldName, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?Type = null) { var filter = new GeoBoundingBoxFilter { TopLeft = geoHashTopLeft, BottomRight = geoHashBottomRight }; return(this.SetDictionary("geo_bounding_box", fieldName, filter, (d, b) => { if (Type.HasValue) { d.Add("type", Enum.GetName(typeof(GeoExecution), Type.Value)); } b.GeoBoundingBoxFilter = d; })); }
public static FilterContainer GeoBoundingBox(string fieldName, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?Type = null) { return(new FilterDescriptor <T>().GeoBoundingBox(fieldName, geoHashTopLeft, geoHashBottomRight, Type)); }
/// <summary> /// A filter allowing to filter hits based on a point location using a bounding box /// </summary> public FilterContainer GeoBoundingBox(string fieldName, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?type = null) { IGeoBoundingBoxFilter filter = new GeoBoundingBoxFilterDescriptor(); filter.TopLeft = geoHashTopLeft; filter.BottomRight = geoHashBottomRight; filter.GeoExecution = type; filter.Field = fieldName; return(this.New(filter, f => f.GeoBoundingBox = filter)); }
public static FilterContainer GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?Type = null) { return(new FilterDescriptor <T>().GeoBoundingBox(fieldDescriptor, geoHashTopLeft, geoHashBottomRight, Type)); }
public static FilterContainer GeoBoundingBox(string fieldName, double topLeftX, double topLeftY, double bottomRightX, double bottomRightY, GeoExecution?Type = null) { return(new FilterDescriptor <T>().GeoBoundingBox(fieldName, topLeftX, topLeftY, bottomRightX, bottomRightY, Type)); }
public GeoBoundingBoxQueryDescriptor <T> Type(GeoExecution?type) => Assign(type, (a, v) => a.Type = v);
/// <summary> /// A filter allowing to filter hits based on a point location using a bounding box /// </summary> public BaseFilter GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, double topLeftX, double topLeftY, double bottomRightX, double bottomRightY, GeoExecution?Type = null) { var field = new PropertyNameResolver().Resolve(fieldDescriptor); return(this.GeoBoundingBox(field, topLeftX, topLeftY, bottomRightX, bottomRightY, Type)); }
public void GeoBoundingBox(string fieldName, double topLeftX, double topLeftY, double bottomRightX, double bottomRightY, GeoExecution?Type = null) { var c = CultureInfo.InvariantCulture; topLeftX.ThrowIfNull("topLeftX"); topLeftY.ThrowIfNull("topLeftY"); bottomRightX.ThrowIfNull("bottomRightX"); bottomRightY.ThrowIfNull("bottomRightY"); this.GeoBoundingBox(fieldName, "{0}, {1}".F(topLeftX.ToString(c), topLeftY.ToString(c)), "{0}, {1}".F(bottomRightX.ToString(c), bottomRightY.ToString(c)), Type); }
public void GeoBoundingBox(string fieldName, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?Type = null) { geoHashTopLeft.ThrowIfNullOrEmpty("geoHashTopLeft"); geoHashBottomRight.ThrowIfNullOrEmpty("geoHashBottomRight"); var filter = new GeoBoundingBoxFilter { TopLeft = geoHashTopLeft, BottomRight = geoHashBottomRight }; this.SetDictionary(fieldName, filter, (d) => { if (Type.HasValue) { d.Add("type", Enum.GetName(typeof(GeoExecution), Type.Value)); } this.GeoBoundingBoxFilter = d; }); }
public void GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, double topLeftX, double topLeftY, double bottomRightX, double bottomRightY, GeoExecution?Type = null) { var field = ElasticClient.PropertyNameResolver.Resolve(fieldDescriptor); this.GeoBoundingBox(field, topLeftX, topLeftY, bottomRightX, bottomRightY, Type); }
public void GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?Type = null) { var field = ElasticClient.PropertyNameResolver.Resolve(fieldDescriptor); this.GeoBoundingBox(field, geoHashTopLeft, geoHashBottomRight, Type); }
public GeoBoundingBoxQueryDescriptor <T> Type(GeoExecution?type) => Assign(a => a.Type = type);
/// <summary> /// A filter allowing to filter hits based on a point location using a bounding box /// </summary> public FilterContainer GeoBoundingBox(string fieldName, double topLeftX, double topLeftY, double bottomRightX, double bottomRightY, GeoExecution?type = null) { var c = CultureInfo.InvariantCulture; topLeftX.ThrowIfNull("topLeftX"); topLeftY.ThrowIfNull("topLeftY"); bottomRightX.ThrowIfNull("bottomRightX"); bottomRightY.ThrowIfNull("bottomRightY"); var geoHashTopLeft = "{0}, {1}".F(topLeftX.ToString(c), topLeftY.ToString(c)); var geoHashBottomRight = "{0}, {1}".F(bottomRightX.ToString(c), bottomRightY.ToString(c)); return(this.GeoBoundingBox(fieldName, geoHashTopLeft, geoHashBottomRight, type)); }
public static FilterContainer GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, double topLeftX, double topLeftY, double bottomRightX, double bottomRightY, GeoExecution?Type = null) { return(new FilterDescriptor <T>().GeoBoundingBox(fieldDescriptor, topLeftX, topLeftY, bottomRightX, bottomRightY, Type)); }
/// <summary> /// A filter allowing to filter hits based on a point location using a bounding box /// </summary> public FilterContainer GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?type = null) { IGeoBoundingBoxFilter filter = new GeoBoundingBoxFilterDescriptor(); filter.TopLeft = geoHashTopLeft; filter.BottomRight = geoHashBottomRight; filter.GeoExecution = type; filter.Field = fieldDescriptor; return(this.New(filter, f => f.GeoBoundingBox = filter)); }
/// <summary> /// A filter allowing to filter hits based on a point location using a bounding box /// </summary> public BaseFilter GeoBoundingBox(Expression <Func <T, object> > fieldDescriptor, string geoHashTopLeft, string geoHashBottomRight, GeoExecution?Type = null) { var field = new PropertyNameResolver().Resolve(fieldDescriptor); return(this.GeoBoundingBox(field, geoHashTopLeft, geoHashBottomRight, Type)); }