Package org.hibernate.search.query.dsl

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


    calendar.set( 1900, 2, 12, 0, 0, 0 );
    Date from = calendar.getTime();
    calendar.set( 1910, 2, 12, 0, 0, 0 );
    Date to = calendar.getTime();

    Query query = monthQb
        .range()
          .onField( "estimatedCreation" )
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
          .from( from )
View Full Code Here


          .to( to ).excludeLimit()
          .createQuery();

    assertEquals( 1, fullTextSession.createFullTextQuery( query, Month.class ).getResultSize() );

    query = monthQb
        .range()
          .onField( "estimatedCreation" )
            .ignoreFieldBridge()
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
View Full Code Here

    calendar.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
    calendar.set( 10 + 1800, 2, 12, 0, 0, 0 );
    Date to = calendar.getTime();

    Query query = monthQb
        .range()
          .onField( "estimatedCreation" )
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
          .below( to )
View Full Code Here

    FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Month.class );
    assertEquals( 1, hibQuery.getResultSize() );
    assertEquals( "March", ( (Month) hibQuery.list().get( 0 ) ).getName() );

    query = monthQb
        .range()
          .onField( "estimatedCreation" )
            .ignoreFieldBridge()
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
View Full Code Here

    hibQuery = fullTextSession.createFullTextQuery( query, Month.class );
    assertEquals( 1, hibQuery.getResultSize() );
    assertEquals( "March", ( (Month) hibQuery.list().get( 0 ) ).getName() );

    query = monthQb.range()
        .onField( "raindropInMm" )
        .below( 0.24d )
        .createQuery();

    assertTrue( query.getClass().isAssignableFrom( NumericRangeQuery.class ) );
View Full Code Here

    calendar.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
    calendar.set( 10 + 1900, 2, 12, 0, 0, 0 );
    Date to = calendar.getTime();

    Query query = monthQb
        .range()
          .onField( "estimatedCreation" )
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
          .above( to )
View Full Code Here

          .createQuery();
    FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Month.class );
    assertEquals( 1, hibQuery.getResultSize() );
    assertEquals( "February", ( (Month) hibQuery.list().get( 0 ) ).getName() );

    query = monthQb
        .range()
          .onField( "estimatedCreation" )
            .ignoreFieldBridge()
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
View Full Code Here

    hibQuery = fullTextSession.createFullTextQuery( query, Month.class );
    assertEquals( 1, hibQuery.getResultSize() );
    assertEquals( "February", ( (Month) hibQuery.list().get( 0 ) ).getName() );

    // test the limits, inclusive
    query = monthQb
        .range()
          .onField( "estimatedCreation" )
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
          .above( february )
View Full Code Here

    hibQuery = fullTextSession.createFullTextQuery( query, Month.class );
    assertEquals( 1, hibQuery.getResultSize() );
    assertEquals( "February", ( (Month) hibQuery.list().get( 0 ) ).getName() );

    // test the limits, exclusive
    query = monthQb
        .range()
          .onField( "estimatedCreation" )
          .andField( "justfortest" )
            .ignoreFieldBridge().ignoreAnalyzer()
          .above( february ).excludeLimit()
View Full Code Here

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

    Query query = monthQb
        .range()
          .onField( "raindropInMm" )
          .from( 0.23d )
          .to( 0.24d )
          .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.