Examples of startAndWait()


Examples of org.hibernate.search.MassIndexer.startAndWait()

     */
    public static void reindex(Class clazz, Session sess) {
        FullTextSession txtSession = Search.getFullTextSession(sess);
        MassIndexer massIndexer = txtSession.createIndexer(clazz);
        try {
            massIndexer.startAndWait();
        } catch (InterruptedException e) {
            log.error("mass reindexing interrupted: " + e.getMessage());
        } finally {
            txtSession.flushToIndexes();
        }
View Full Code Here

Examples of org.hibernate.search.MassIndexer.startAndWait()

        FullTextSession txtSession = Search.getFullTextSession(sess);
        MassIndexer massIndexer = txtSession.createIndexer();
        massIndexer.purgeAllOnStart(true);
        try {
            if (!async) {
                massIndexer.startAndWait();
            } else {
                massIndexer.start();
            }
        } catch (InterruptedException e) {
            log.error("mass reindexing interrupted: " + e.getMessage());
View Full Code Here

Examples of org.hibernate.search.MassIndexer.startAndWait()

  public void testReindexedOnce() throws InterruptedException {
    Assert.assertEquals( 2, countBooksInIndex() );
    Session session = openSession();
    FullTextSession fullTextSession = Search.getFullTextSession( session );
    MassIndexer massIndexer = fullTextSession.createIndexer();
    massIndexer.startAndWait();
    session.close();
    Assert.assertEquals( 2, countBooksInIndex() );
  }

  private int countBooksInIndex() {
View Full Code Here

Examples of org.hibernate.search.MassIndexer.startAndWait()

    verifyMatchExistsWithName( "name", "name" );

    Session session = openSession();
    FullTextSession fullTextSession = Search.getFullTextSession( session );
    MassIndexer massIndexer = fullTextSession.createIndexer( Root.class );
    massIndexer.startAndWait();
    verifyMatchExistsWithName( "name", "name" );
  }

  private void verifyMatchExistsWithName(String fieldName, String fieldValue) {
    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
View Full Code Here

Examples of org.hibernate.search.MassIndexer.startAndWait()

    verifyMatchExistsWithName( "lazyEntity.name", TEST_NAME_CONTENT );
    verifyMatchExistsWithName( "lazyEntity2.name", TEST_NAME_CONTENT );

    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    MassIndexer massIndexer = fullTextSession.createIndexer( IndexedEmbeddedProxyRootEntity.class );
    massIndexer.startAndWait();
    fullTextSession.close();

    verifyMatchExistsWithName( "lazyEntity.name", TEST_NAME_CONTENT );
    verifyMatchExistsWithName( "lazyEntity2.name", TEST_NAME_CONTENT );
  }
View Full Code Here

Examples of org.hibernate.search.MassIndexer.startAndWait()

  private void massIndexFooInstances(MassIndexerProgressMonitor monitor) throws InterruptedException {
    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    MassIndexer massIndexer = fullTextSession.createIndexer( Foo.class );
    massIndexer.progressMonitor( monitor );
    massIndexer.startAndWait();
    fullTextSession.close();
  }

  private void indexSingleFooInstance() {
    Session session = openSession();
View Full Code Here

Examples of org.hibernate.search.MassIndexer.startAndWait()

    verifyMatchExistsWithName( "name", "name" );

    Session session = openSession();
    FullTextSession fullTextSession = Search.getFullTextSession( session );
    MassIndexer massIndexer = fullTextSession.createIndexer( Root.class );
    massIndexer.startAndWait();
    verifyMatchExistsWithName( "name", "name" );
  }

  private void verifyMatchExistsWithName(String fieldName, String fieldValue) {
    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
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.