}
@Test
public void testSpatialQueries() {
Transaction transaction = fullTextSession.beginTransaction();
final QueryBuilder builder = fullTextSession.getSearchFactory()
.buildQueryBuilder().forEntity( POI.class ).get();
Coordinates coordinates = Point.fromDegrees( 24d, 31.5d );
Query query = builder
.spatial()
.onCoordinates( "location" )
.within( 51, Unit.KM )
.ofCoordinates( coordinates )
.createQuery();
List<?> results = fullTextSession.createFullTextQuery( query, POI.class ).list();
assertEquals( "test spatial hash based spatial query", 1, results.size() );
assertEquals( "test spatial hash based spatial query", "Bozo", ( (POI) results.get( 0 ) ).getName() );
query = builder
.spatial()
.onCoordinates( "location" )
.within( 500, Unit.KM )
.ofLatitude( 48.858333d ).andLongitude( 2.294444d )
.createQuery();