Exemple #1
0
        /// <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));
        }
Exemple #2
0
        /// <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;
            }));
        }
Exemple #3
0
 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));
        }
Exemple #5
0
 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));
 }
Exemple #6
0
 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));
 }
Exemple #7
0
 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));
        }
Exemple #9
0
        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);
        }
Exemple #10
0
        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;
            });
        }
Exemple #11
0
        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);
        }
Exemple #12
0
        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);
        }
Exemple #13
0
 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));
        }
Exemple #15
0
 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));
        }