Examples of spatial()


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

    hibQuery = session.createFullTextQuery( luceneQuery, LatLongAnnTestPoi.class );
    results = hibQuery.list();
    assertEquals( 0, results.size() );

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

    hibQuery2 = session.createFullTextQuery( luceneQuery2, LatLongAnnTestPoi.class );
    results2 = hibQuery2.list();
    assertEquals( 1, results2.size() );
View Full Code Here

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

    double centerLatitude = 24.0d;
    double centerLongitude = 32.0d;

    final QueryBuilder builder = em.getSearchFactory().buildQueryBuilder().forEntity( POI.class ).get();

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

    FullTextQuery hibQuery = em.createFullTextQuery( luceneQuery, POI.class );
    hibQuery.setProjection( FullTextQuery.THIS, FullTextQuery.SPATIAL_DISTANCE );
    hibQuery.setSpatialParameters( centerLatitude, centerLongitude, "location" );
View Full Code Here

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

    double centerLatitude = 24.0d;
    double centerLongitude = 32.0d;

    final QueryBuilder builder = em.getSearchFactory().buildQueryBuilder().forEntity( POI.class ).get();

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

    FullTextQuery hibQuery = em.createFullTextQuery( luceneQuery, POI.class );
    Sort distanceSort = new Sort( new DistanceSortField( centerLatitude, centerLongitude, "location" ) );
    hibQuery.setSort( distanceSort );
View Full Code Here

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

    double centerLatitude = 50.7753455;
    double centerLongitude = 6.083886799999959;

    final QueryBuilder builder = em.getSearchFactory().buildQueryBuilder().forEntity( POI.class ).get();

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

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

    double centerLatitude = 24.0d;
    double centerLongitude = 32.0d;

    final QueryBuilder builder = em.getSearchFactory().buildQueryBuilder().forEntity( POI.class ).get();

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

    FullTextQuery hibQuery = em.createFullTextQuery( luceneQuery, POI.class );
    Sort distanceSort = new Sort( new DistanceSortField( centerLatitude, centerLongitude, "location" ) );
    hibQuery.setSort( distanceSort );
View Full Code Here

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

    FullTextSession fTxtSess = Search.getFullTextSession( sessionHbn );

    QueryBuilder builder = fTxtSess.getSearchFactory().buildQueryBuilder().forEntity( GeoEntity.class ).get();

    org.apache.lucene.search.Query luceneQuery = builder.spatial()
        .onDefaultCoordinates()
        .within( distance, Unit.KM )
        .ofLatitude( startLat )
        .andLongitude( startLon )
        .createQuery();
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.