Examples of spatial()


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

    double centerLongitude = 31.5;

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

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

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, UserRange.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, UserRange.class );
    List results = hibQuery.list();
    Assert.assertEquals( 0, results.size() );

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

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

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

  @Test
  public void testSpatialsAnnotation() throws Exception {
    final QueryBuilder builder = fullTextSession.getSearchFactory()
        .buildQueryBuilder().forEntity( UserEx.class ).get();

    org.apache.lucene.search.Query luceneQuery = builder.spatial().onDefaultCoordinates()
        .within( 100.0d, Unit.KM ).ofLatitude( 24.0d ).andLongitude( 31.5d ).createQuery();

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

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

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

    org.apache.lucene.search.Query luceneQuery2 = builder.spatial().onCoordinates( "work" )
        .within( 100.0d, Unit.KM ).ofLatitude( 12.0d ).andLongitude( 27.5d ).createQuery();

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

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

        .buildQueryBuilder().forEntity( RangeEvent.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 = fullTextSession.createFullTextQuery( luceneQuery, RangeEvent.class );

View Full Code Here

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


    List results = hibQuery.list();
    Assert.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 = fullTextSession.createFullTextQuery( luceneQuery2, RangeEvent.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( Hotel.class ).get();

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

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, Hotel.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, Hotel.class );
    List results = hibQuery.list();
    Assert.assertEquals( 0, results.size() );

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

    org.hibernate.Query hibQuery2 = fullTextSession.createFullTextQuery( luceneQuery2, Hotel.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( RangeHotel.class ).get();

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


    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, RangeHotel.class );
    List results = hibQuery.list();
View Full Code Here

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

    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery( luceneQuery, RangeHotel.class );
    List results = hibQuery.list();
    Assert.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 = fullTextSession.createFullTextQuery( luceneQuery2, RangeHotel.class );
    List results2 = hibQuery2.list();
    Assert.assertEquals( 1, results2.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.