Examples of flushToIndexes()


Examples of org.hibernate.search.FullTextSession.flushToIndexes()

      s.createSQLQuery( "delete from book where id < :id" ).setParameter( "id", initialOffset ).executeUpdate();
      s.createSQLQuery( "delete from author where id < :id" ).setParameter( "id", initialOffset ).executeUpdate();

      s.purgeAll( Book.class );
      s.flush();
      s.flushToIndexes();
      tx.commit();
    }
    finally {
      s.close();
    }
View Full Code Here

Examples of org.hibernate.search.FullTextSession.flushToIndexes()

            Double.parseDouble( data[5] ),
            data[7]
        );
        session.save( current );
        if ( ( line_number % 10000 ) == 0 ) {
          fullTextSession.flushToIndexes();
          session.getTransaction().commit();
          session.close();
          session = sessionFactory.openSession();
          fullTextSession = Search.getFullTextSession( session );
          session.beginTransaction();
View Full Code Here

Examples of org.hibernate.search.FullTextSession.flushToIndexes()

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    try {
      s.persist( incorrect );
      s.flush();
      s.flushToIndexes();
      fail( "Incorrect bridge should fail" );
    }
    catch (BridgeException e) {
      tx.rollback();
    }
View Full Code Here

Examples of org.hibernate.search.FullTextSession.flushToIndexes()

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    try {
      s.persist( incorrect );
      s.flush();
      s.flushToIndexes();
      fail( "Incorrect bridge should fail" );
    }
    catch (BridgeException e) {
      tx.rollback();
    }
View Full Code Here

Examples of org.hibernate.search.FullTextSession.flushToIndexes()

    while ( results.next() ) {
      index++;
      final Email o = (Email) results.get( 0 );
      s.index( o );
      if ( index % 5 == 0 ) {
        s.flushToIndexes();
        s.clear();
      }
    }
    tx.commit();
    s.clear();
View Full Code Here

Examples of org.hibernate.search.FullTextSession.flushToIndexes()

    int index = 0;
    while ( results.next() ) {
      index++;
      fullTextSession.index( results.get( 0 ) );
      if ( index % BATCH_SIZE == 0 ) {
        fullTextSession.flushToIndexes();
        fullTextSession.clear();
      }
    }
    fullTextSession.flush();
    transaction.commit();
View Full Code Here

Examples of org.hibernate.search.FullTextSession.flushToIndexes()

     * Force to push HIBERNATE domains saved to HIBERNATE SEARCH indexes.
     * This is useful to test full text session search on test cases.
     */
    public void flushIndexes(){
        final FullTextSession fullTextSession = Search.getFullTextSession(getHibernateTemplate().getSessionFactory().getCurrentSession());
        fullTextSession.flushToIndexes();
    }

    /**
     * @return the userDao
     */
 
View Full Code Here

Examples of org.hibernate.search.FullTextSession.flushToIndexes()

  }

  private void purge() {
    FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession( ( Session ) em.getDelegate() );
    ftSession.purgeAll( Book.class );
    ftSession.flushToIndexes();
    ftSession.close();
    emf.close();
  }

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

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

        try {
            massIndexer.startAndWait();
        } catch (InterruptedException e) {
            log.error("mass reindexing interrupted: " + e.getMessage());
        } finally {
            txtentityManager.flushToIndexes();
        }
    }

    /**
     * Regenerates all the indexed class indexes
View Full Code Here

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

                massIndexer.start();
            }
        } catch (InterruptedException e) {
            log.error("mass reindexing interrupted: " + e.getMessage());
        } finally {
            txtentityManager.flushToIndexes();
        }
    }
}
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.