Examples of flushToIndexes()


Examples of org.hibernate.search.jpa.FullTextEntityManager.flushToIndexes()

  private void purgeAll(Class<?>... entityTypes) throws Exception {
    FullTextEntityManager fullTextEm = Search.getFullTextEntityManager( createEntityManager() );
    for ( Class<?> entityType : entityTypes ) {
      fullTextEm.purgeAll( entityType );
      fullTextEm.flushToIndexes();
    }
    int numDocs = fullTextEm.getSearchFactory().getIndexReaderAccessor().open( entityTypes ).numDocs();
    close( fullTextEm );
    assertThat( numDocs ).isEqualTo( 0 );
  }
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextEntityManager.flushToIndexes()

     * Flush search indexes, to be done after a reindex() or reindexAll() operation
     */
    public void flushSearchIndexes() {
        EntityManagerFactory entityManagerFactory = (EntityManagerFactory) applicationContext.getBean("entityManagerFactory");
        FullTextEntityManager fullTextEntityMgr = Search.getFullTextEntityManager(entityManagerFactory.createEntityManager());
        fullTextEntityMgr.flushToIndexes();
    }
}
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextEntityManager.flushToIndexes()

  }

  private void purge() {
    FullTextEntityManager ftEm = org.hibernate.search.jpa.Search.getFullTextEntityManager( em );
    ftEm.purgeAll( Book.class );
    ftEm.flushToIndexes();
    ftEm.close();
    emf.close();
  }

  private List<Book> search(String searchQuery) throws ParseException {
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextEntityManager.flushToIndexes()

  @After
  public void tearDown() {
    FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager( entityManager );
    fullTextEntityManager.purgeAll( Book.class );
    fullTextEntityManager.flushToIndexes();
    fullTextEntityManager.close();
    super.tearDown();
  }

  @Test
View Full Code Here

Examples of org.hibernate.search.jpa.FullTextEntityManager.flushToIndexes()

    // verify against index
    assertEquals( 1, countBretzelsViaIndex( em ) );
    em.purgeAll( Bretzel.class );

    // clear index
    em.flushToIndexes();

    // verify Bretzel removed from index
    assertEquals( 0, countBretzelsViaIndex( em ) );

    // re-index
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.