Examples of enableFullTextFilter()


Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    query.add( new TermQuery( new Term("teacher", "aaron") ), BooleanClause.Occur.SHOULD );
    FullTextQuery ftQuery = s.createFullTextQuery( query, Driver.class );
    assertEquals("No filter should happen", 3, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    assertEquals("Should filter out Gavin", 2, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    assertEquals("Should filter out Gavin", 2, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    assertEquals("Should filter to limit to Emmanuel", 1, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    ftQuery.enableFullTextFilter( "bestDriver");
    assertEquals("Should filter out Gavin", 2, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    assertEquals("Should filter to limit to Emmanuel", 1, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    assertEquals("Should filter to limit to Emmanuel", 1, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    ftQuery.disableFullTextFilter( "security");
    ftQuery.disableFullTextFilter( "bestDriver");
    assertEquals("Should not filter anymore", 3, ftQuery.getResultSize() );
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    assertEquals("Should filter to limit to Emmanuel", 1, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    ftQuery.disableFullTextFilter( "security");
    ftQuery.disableFullTextFilter( "bestDriver");
    assertEquals("Should not filter anymore", 3, ftQuery.getResultSize() );

    s.getTransaction().commit();
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    query.add( new TermQuery( new Term("teacher", "aaron") ), BooleanClause.Occur.SHOULD );
    FullTextQuery ftQuery = s.createFullTextQuery( query, Driver.class );
    assertEquals("No filter should happen", 3, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "cachetest");
    assertEquals("Should filter out all", 0, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "cachetest");
    try {
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "cachetest");
    assertEquals("Should filter out all", 0, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "cachetest");
    try {
      ftQuery.getResultSize();
    }
    catch (IllegalStateException e) {
      fail("Cache does not work");
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    query.add( new TermQuery( new Term("teacher", "max") ), BooleanClause.Occur.SHOULD );
    query.add( new TermQuery( new Term("teacher", "aaron") ), BooleanClause.Occur.SHOULD );
    FullTextQuery ftQuery;

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "bestDriver");
    Filter dateFilter = new RangeFilter("delivery", "2001", "2005",
        true, true);
    ftQuery.setFilter( dateFilter );
    assertEquals("Should select only liz", 1, ftQuery.getResultSize() );
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    ftQuery.setFilter( dateFilter );
    assertEquals("Should select only liz", 1, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.setFilter( dateFilter );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    ftQuery.disableFullTextFilter( "security");
    ftQuery.disableFullTextFilter( "bestDriver");
    ftQuery.setFilter( null );
    assertEquals("Should not filter anymore", 3, ftQuery.getResultSize() );
View Full Code Here

Examples of org.hibernate.search.FullTextQuery.enableFullTextFilter()

    assertEquals("Should select only liz", 1, ftQuery.getResultSize() );

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.setFilter( dateFilter );
    ftQuery.enableFullTextFilter( "bestDriver");
    ftQuery.enableFullTextFilter( "security").setParameter( "login", "andre" );
    ftQuery.disableFullTextFilter( "security");
    ftQuery.disableFullTextFilter( "bestDriver");
    ftQuery.setFilter( null );
    assertEquals("Should not filter anymore", 3, ftQuery.getResultSize() );
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.