Package org.hibernate.search.query.dsl

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


    Transaction transaction = fullTextSession.beginTransaction();
    final QueryBuilder monthQb = fullTextSession.getSearchFactory()
        .buildQueryBuilder().forEntity( Month.class ).get();

    //inclusive
    Query query = monthQb
        .range()
          .onField( "raindropInMm" )
          .above( 0.231d )
          .createQuery();
View Full Code Here


    List<?> results = fullTextSession.createFullTextQuery( query, Month.class ).list();
    assertThat( results ).onProperty( "name" ).containsOnly( "January", "February", "March" );

    //exclusive
    query = monthQb
        .range()
          .onField( "raindropInMm" )
          .above( 0.231d )
          .excludeLimit()
          .createQuery();
View Full Code Here

    Transaction transaction = fullTextSession.beginTransaction();
    final QueryBuilder monthQb = fullTextSession.getSearchFactory()
        .buildQueryBuilder().forEntity( Month.class ).get();

    //inclusive
    Query query = monthQb
        .range()
          .onField( "raindropInMm" )
          .below( 0.435d )
          .createQuery();
View Full Code Here

    List<?> results = fullTextSession.createFullTextQuery( query, Month.class ).list();
    assertThat( results ).onProperty( "name" ).containsOnly( "January", "February", "March" );

    //exclusive
    query = monthQb
        .range()
          .onField( "raindropInMm" )
          .below( 0.435d )
          .excludeLimit()
          .createQuery();
View Full Code Here

        double radius = 25.0d;
        Rectangle boundingBox = Rectangle.fromBoundingCircle( center, radius );

        query = queryBuilder.bool()
            .must(
                queryBuilder.range()
                    .onField( "latitude" )
                    .from( boundingBox.getLowerLeft().getLatitude() )
                    .to( boundingBox.getUpperRight().getLatitude() )
                    .createQuery()
            )
View Full Code Here

                    .from( boundingBox.getLowerLeft().getLatitude() )
                    .to( boundingBox.getUpperRight().getLatitude() )
                    .createQuery()
            )
            .must(
                queryBuilder.range()
                    .onField( "longitude" )
                    .from( boundingBox.getLowerLeft().getLongitude() )
                    .to( boundingBox.getUpperRight().getLongitude() )
                    .createQuery()
            )
View Full Code Here

        }
        session.clear();

        query = queryBuilder.bool()
            .must(
                queryBuilder.range()
                    .onField( "latitude" )
                    .from( boundingBox.getLowerLeft().getLatitude() )
                    .to( boundingBox.getUpperRight().getLatitude() )
                    .createQuery()
            )
View Full Code Here

                    .from( boundingBox.getLowerLeft().getLatitude() )
                    .to( boundingBox.getUpperRight().getLatitude() )
                    .createQuery()
            )
            .must(
                queryBuilder.range()
                    .onField( "longitude" )
                    .from( boundingBox.getLowerLeft().getLongitude() )
                    .to( boundingBox.getUpperRight().getLongitude() )
                    .createQuery()
            )
View Full Code Here

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

    Query rootQuery = queryBuilder.bool()
        .must( queryBuilder.range().onField( "price" ).above( 10000l ).createQuery() )
        .must( queryBuilder.range().onField( "price" ).below( 20000l ).createQuery() )
        .createQuery();

    @SuppressWarnings( "unchecked" )
    List<Item> resultList = (List<Item>) fullTextSession.createFullTextQuery( rootQuery, Item.class ).list();
View Full Code Here

        .forEntity( Item.class )
        .get();

    Query rootQuery = queryBuilder.bool()
        .must( queryBuilder.range().onField( "price" ).above( 10000l ).createQuery() )
        .must( queryBuilder.range().onField( "price" ).below( 20000l ).createQuery() )
        .createQuery();

    @SuppressWarnings( "unchecked" )
    List<Item> resultList = (List<Item>) fullTextSession.createFullTextQuery( rootQuery, Item.class ).list();
    assertNotNull( resultList );
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.