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( "cacheresultstest");
    assertEquals("Should filter out all", 0, ftQuery.getResultSize() );
   
    // HSEARCH-174 - we call System.gc() to force a garbage collection.
    // Prior to the fix for HSEARCH-174 this would cause the filter to be
    // garbage collected since Lucene used weak references.
View Full Code Here

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

    // Prior to the fix for HSEARCH-174 this would cause the filter to be
    // garbage collected since Lucene used weak references.
    System.gc();

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

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

    catch (IllegalStateException e) {
      fail("Cache results does not work");
    }

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

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

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

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

    ftQuery = s.createFullTextQuery( query, Driver.class );
    ftQuery.enableFullTextFilter( "cacheinstancetest");
    try {
      ftQuery.getResultSize();
      fail("Cache instance does not work");
    }
    catch (IllegalStateException e) {
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
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.