Examples of spatial()


Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

    Assert.assertEquals( 1, results2.size() );

    double endOfTheWorldLatitude = 0.0d;
    double endOfTheWorldLongitude = 180.0d;

    org.apache.lucene.search.Query luceneQuery3 = builder.spatial()
        .onCoordinates( "location" )
        .within( 112, Unit.KM )
        .ofLatitude( endOfTheWorldLatitude )
        .andLongitude( endOfTheWorldLongitude )
        .createQuery();
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

    org.hibernate.Query hibQuery3 = fullTextSession.createFullTextQuery( luceneQuery3, RangeHotel.class );
    List results3 = hibQuery3.list();
    Assert.assertEquals( 2, results3.size() );

    org.apache.lucene.search.Query luceneQuery4 = builder.spatial()
        .onCoordinates( "location" )
        .within( 100000, Unit.KM )
        .ofLatitude( endOfTheWorldLatitude )
        .andLongitude( endOfTheWorldLongitude )
        .createQuery();
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

        .buildQueryBuilder().forEntity( Restaurant.class ).get();

    double centerLatitude = 24;
    double centerLongitude = 31.5;

    org.apache.lucene.search.Query luceneQuery = builder.spatial().onCoordinates( "position.location" )
        .within( 50, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, Restaurant.class );
    List results = hibQuery.list();
    Assert.assertEquals( 0, results.size() );
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, Restaurant.class );
    List results = hibQuery.list();
    Assert.assertEquals( 0, results.size() );

    org.apache.lucene.search.Query luceneQuery2 = builder.spatial().onCoordinates( "position.location" )
        .within( 51, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    org.hibernate.Query hibQuery2 = fullTextSession.createFullTextQuery( luceneQuery2, Restaurant.class );
    List results2 = hibQuery2.list();
    Assert.assertEquals( 1, results2.size() );
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

    double centerLongitude = 31.5;

    final QueryBuilder builder = fullTextSession.getSearchFactory()
        .buildQueryBuilder().forEntity( GetterUser.class ).get();

    org.apache.lucene.search.Query luceneQuery = builder.spatial().onCoordinates( "home" )
        .within( 50, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, GetterUser.class );
    List results = hibQuery.list();
    Assert.assertEquals( 0, results.size() );
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, GetterUser.class );
    List results = hibQuery.list();
    Assert.assertEquals( 0, results.size() );

    org.apache.lucene.search.Query luceneQuery2 = builder.spatial().onCoordinates( "home" )
        .within( 51, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    org.hibernate.Query hibQuery2 = fullTextSession.createFullTextQuery( luceneQuery2, GetterUser.class );
    List results2 = hibQuery2.list();
    Assert.assertEquals( 1, results2.size() );
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

      double radius,
      int expectedPoiCount) {
    final QueryBuilder builder = fullTextSession.getSearchFactory()
        .buildQueryBuilder().forEntity( POI.class ).get();

    org.apache.lucene.search.Query luceneQuery = builder.spatial().onCoordinates( "location" )
        .within( radius, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, POI.class );
    List results = hibQuery.list();
    Assert.assertEquals( "Unexpected number of POIs within radius", expectedPoiCount, results.size() );
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

        .buildQueryBuilder().forEntity( MemberLevelTestPoI.class ).get();

    double centerLatitude = 24;
    double centerLongitude = 31.5;

    org.apache.lucene.search.Query luceneQuery = builder.spatial().onCoordinates( "location" )
        .within( 50, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    org.hibernate.Query hibQuery = session.createFullTextQuery( luceneQuery, MemberLevelTestPoI.class );
    List<?> results = hibQuery.list();
    assertEquals( 0, results.size() );
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

    org.hibernate.Query hibQuery = session.createFullTextQuery( luceneQuery, MemberLevelTestPoI.class );
    List<?> results = hibQuery.list();
    assertEquals( 0, results.size() );

    org.apache.lucene.search.Query luceneQuery2 = builder.spatial().onCoordinates( "location" )
        .within( 51, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    org.hibernate.Query hibQuery2 = session.createFullTextQuery( luceneQuery2, MemberLevelTestPoI.class );
    List<?> results2 = hibQuery2.list();
    assertEquals( 1, results2.size() );
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.spatial()

        .buildQueryBuilder().forEntity( LatLongAnnTestPoi.class ).get();

    centerLatitude = 24;
    centerLongitude = 31.5;

    luceneQuery = builder.spatial().onCoordinates( "location" )
        .within( 50, Unit.KM ).ofLatitude( centerLatitude ).andLongitude( centerLongitude ).createQuery();

    hibQuery = session.createFullTextQuery( luceneQuery, LatLongAnnTestPoi.class );
    results = hibQuery.list();
    assertEquals( 0, results.size() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.