Exemple #1
0
		internal override Lucene.Net.Search.Filter GetFilter()
		{
			var dq = new Lucene.Net.Spatial.Tier.DistanceQueryBuilder(
					Latitude, Longitude, Radius,
					SpatialIndex.LatField, 
					SpatialIndex.LngField, 
					Lucene.Net.Spatial.Tier.Projectors.CartesianTierPlotter.DefaltFieldPrefix, 
					true);

			return dq.Filter;
		}
Exemple #2
0
		public static Filter GetFilter(this IndexQuery self)
		{
			var spatialIndexQuery = self as SpatialIndexQuery;
			if(spatialIndexQuery != null)
			{
				var dq = new Lucene.Net.Spatial.Tier.DistanceQueryBuilder(
					spatialIndexQuery.Latitude,
					spatialIndexQuery.Longitude,
					spatialIndexQuery.Radius,
					SpatialIndex.LatField,
					SpatialIndex.LngField,
					Lucene.Net.Spatial.Tier.Projectors.CartesianTierPlotter.DefaltFieldPrefix,
					true);

				return dq.Filter;
			}
			return null;
		}
        public static Filter GetFilter(this IndexQuery self)
        {
            var spatialIndexQuery = self as SpatialIndexQuery;

            if (spatialIndexQuery != null)
            {
                var dq = new Lucene.Net.Spatial.Tier.DistanceQueryBuilder(
                    spatialIndexQuery.Latitude,
                    spatialIndexQuery.Longitude,
                    spatialIndexQuery.Radius,
                    SpatialIndex.LatField,
                    SpatialIndex.LngField,
                    Lucene.Net.Spatial.Tier.Projectors.CartesianTierPlotter.DefaltFieldPrefix,
                    true);

                return(dq.Filter);
            }
            return(null);
        }
Exemple #4
0
		internal override Lucene.Net.Search.Sort GetSort(IndexDefinition indexDefinition)
		{
			if (SortByDistance == false)
				return base.GetSort(indexDefinition);

			var dq = new Lucene.Net.Spatial.Tier.DistanceQueryBuilder(
					Latitude, Longitude, Radius,
					SpatialIndex.LatField,
					SpatialIndex.LngField,
					Lucene.Net.Spatial.Tier.Projectors.CartesianTierPlotter.DefaltFieldPrefix,
					true);
			var dsort = new Lucene.Net.Spatial.Tier.DistanceFieldComparatorSource(dq.DistanceFilter);
			return new Lucene.Net.Search.Sort(new Lucene.Net.Search.SortField("foo", dsort, false));
		}