org.hibernate.search.spatial.impl
Class SpatialQueryBuilderFromPoint

java.lang.Object
  extended by org.hibernate.search.spatial.impl.SpatialQueryBuilderFromPoint

public abstract class SpatialQueryBuilderFromPoint
extends Object

The SpatialQueryBuilder holds builder methods for Quad Tree, Distance and Spatial (Quad Tree+Distance) filters and queries

Author:
Nicolas Helleringer

Constructor Summary
SpatialQueryBuilderFromPoint()
           
 
Method Summary
static org.apache.lucene.search.Filter buildDistanceFilter(org.apache.lucene.search.Filter previousFilter, Point center, double radius, String coordinatesField)
          Returns a Lucene filter to fine filter document by distance
static org.apache.lucene.search.Filter buildDistanceFilter(org.apache.lucene.search.Filter previousFilter, Point center, double radius, String latitudeField, String longitudeField)
          Returns a Lucene filter to fine filter document by distance
static org.apache.lucene.search.Query buildDistanceQuery(Point center, double radius, String fieldName)
          Returns a Lucene Query searching directly by computing distance against all docs in the index (costly !)
static org.apache.lucene.search.Filter buildQuadTreeFilter(Point center, double radius, String fieldName)
          Returns a Lucene filter which rely on Hibernate Search Spatial quad tree indexation to filter document at radius
static org.apache.lucene.search.Query buildQuadTreeQuery(Point center, double radius, String fieldName)
          Returns a Lucene Query which rely on Hibernate Search Spatial quad tree indexation to filter document at radius by wrapping a QuadTreeFilter
static org.apache.lucene.search.Query buildSpatialQueryByQuadTree(Point center, double radius, String fieldName)
          Returns a Lucene Query which relies on Hibernate Search Spatial quad tree indexation to filter documents at radius and filter its results by a fine DistanceFilter
static org.apache.lucene.search.Query buildSpatialQueryByRange(Point center, double radius, String fieldName)
          Returns a Lucene Query which rely on double numeric range query on Latitude / Longitude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpatialQueryBuilderFromPoint

public SpatialQueryBuilderFromPoint()
Method Detail

buildQuadTreeFilter

public static org.apache.lucene.search.Filter buildQuadTreeFilter(Point center,
                                                                  double radius,
                                                                  String fieldName)
Returns a Lucene filter which rely on Hibernate Search Spatial quad tree indexation to filter document at radius

Parameters:
center - center of the search discus
radius - distance max to center in km
fieldName - name of the Lucene Field implementing Coordinates
Returns:
Lucene filter to be used in a Query
See Also:
Query, Coordinates, Filter

buildDistanceFilter

public static org.apache.lucene.search.Filter buildDistanceFilter(org.apache.lucene.search.Filter previousFilter,
                                                                  Point center,
                                                                  double radius,
                                                                  String coordinatesField)
Returns a Lucene filter to fine filter document by distance

Parameters:
center - center of the search discus
radius - distance max to center in km
coordinatesField - name of the Lucene Field implementing Coordinates
previousFilter - preceding filter in filter chain Warning if passed null DistanceFilter constructor use a filter wrapped match all query (time/resource consuming !)
Returns:
Lucene filter to be used in a Query
See Also:
Query, Coordinates, DistanceFilter, Filter

buildDistanceFilter

public static org.apache.lucene.search.Filter buildDistanceFilter(org.apache.lucene.search.Filter previousFilter,
                                                                  Point center,
                                                                  double radius,
                                                                  String latitudeField,
                                                                  String longitudeField)
Returns a Lucene filter to fine filter document by distance

Parameters:
center - center of the search discus
radius - distance max to center in km
latitudeField - name of the Lucene Field hosting latitude
longitudeField - name of the Lucene Field hosting longitude
previousFilter - preceding filter in filter chain Warning if passed null DistanceFilter constructor use a filter wrapped match all query (time/ressource consuming !)
Returns:
Lucene filter to be used in a Query
See Also:
Query, Coordinates, DistanceFilter, Filter

buildQuadTreeQuery

public static org.apache.lucene.search.Query buildQuadTreeQuery(Point center,
                                                                double radius,
                                                                String fieldName)
Returns a Lucene Query which rely on Hibernate Search Spatial quad tree indexation to filter document at radius by wrapping a QuadTreeFilter

Parameters:
center - center of the search discus
radius - distance max to center in km
fieldName - name of the Lucene Field implementing Coordinates
Returns:
Lucene Query to be used in a search
See Also:
Query, Coordinates

buildDistanceQuery

public static org.apache.lucene.search.Query buildDistanceQuery(Point center,
                                                                double radius,
                                                                String fieldName)
Returns a Lucene Query searching directly by computing distance against all docs in the index (costly !)

Parameters:
center - center of the search discus
radius - distance max to center in km
fieldName - name of the Lucene Field implementing Coordinates
Returns:
Lucene Query to be used in a search
See Also:
Query, Coordinates

buildSpatialQueryByQuadTree

public static org.apache.lucene.search.Query buildSpatialQueryByQuadTree(Point center,
                                                                         double radius,
                                                                         String fieldName)
Returns a Lucene Query which relies on Hibernate Search Spatial quad tree indexation to filter documents at radius and filter its results by a fine DistanceFilter

Parameters:
center - center of the search discus
radius - distance max to center in km
fieldName - name of the Lucene Field implementing Coordinates
Returns:
Lucene Query to be used in a search
See Also:
Query, Coordinates

buildSpatialQueryByRange

public static org.apache.lucene.search.Query buildSpatialQueryByRange(Point center,
                                                                      double radius,
                                                                      String fieldName)
Returns a Lucene Query which rely on double numeric range query on Latitude / Longitude

Parameters:
center - center of the search discus
radius - distance max to center in km
fieldName - name of the Lucene Field implementing Coordinates
Returns:
Lucene Query to be used in a search
See Also:
Query, Coordinates


Copyright © 2006-2013 Red Hat Middleware, LLC. All Rights Reserved