Examples of flushToIndexes()


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

  }

  private void purgeAll(Class<?> entityType) {
    FullTextSession session = Search.getFullTextSession( openSession() );
    session.purgeAll( entityType );
    session.flushToIndexes();
    int numDocs = session.getSearchFactory().getIndexReaderAccessor().open( entityType ).numDocs();
    session.close();
    assertThat( numDocs ).isEqualTo( 0 );
  }
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();
  }

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

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

        FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
        List results = ftSession.createCriteria(Book.class).list();
        for (Object obj : results) {
            ftSession.index(obj);
        }
    ftSession.flushToIndexes();
    }

    private void purge() {
        FullTextSession ftSession = org.hibernate.search.Search.getFullTextSession((Session) em.getDelegate());
        ftSession.purgeAll(Book.class);
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.FullTextSession.flushToIndexes()

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

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

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

                massIndexer.start();
            }
        } catch (InterruptedException e) {
            log.error("mass reindexing interrupted: " + e.getMessage());
        } finally {
            txtSession.flushToIndexes();
        }
    }
}
View Full Code Here

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

     * Flush search indexes, to be done after a reindex() or reindexAll() operation
     */
    public void flushSearchIndexes() {
        Session currentSession = sessionFactory.getCurrentSession();
        final FullTextSession fullTextSession = Search.getFullTextSession(currentSession);
        fullTextSession.flushToIndexes();
    }
}
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()

  }

  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.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
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.