Examples of openFullTextSession()


Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

  private void invokeTest(boolean indexMetadataIsComplete, int expectedBackendOperations) {
    FullTextSessionBuilder fullTextSessionBuilder = createSearchFactory( indexMetadataIsComplete );
    try {
      LeakingOptimizer.reset();
      LeakingLuceneBackend.reset();
      FullTextSession session = fullTextSessionBuilder.openFullTextSession();
      Assert.assertEquals( 0, LeakingOptimizer.getTotalOperations() );

      Transaction tx = session.beginTransaction();
      session.persist( new Document( "The Book", "many paper pages assembled together at one side", "[old language you don't understand]" ) );
      tx.commit();
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

      //create initial data
      initializeData( fullTextSessionBuilder );
      //this should have triggered 5 indexing operations, no entity loadings:
      assertOperationsPerformed( 5 );
      assertLocationsLoaded( 0 );
      FullTextSession fullTextSession = fullTextSessionBuilder.openFullTextSession();
      //now check index state:
      assertFoundLocations( fullTextSession, "floor", 5 );
      assertFoundLocations( fullTextSession, "airport", 0 );
      fullTextSession.clear();
      try {
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

        depth,
        withClassBridgeOnCatalog
    );
    try {
      initializeData( fulltextSessionBuilder );
      FullTextSession fullTextSession = fulltextSessionBuilder.openFullTextSession();
      try {
        Catalog catalog = (Catalog) fullTextSession.get( Catalog.class, 1L );
        PersistentSet catalogItems = (PersistentSet) catalog.getCatalogItems();
        PersistentBag consumers = (PersistentBag) catalog.getConsumers();
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

        .addAnnotatedClass( AncientBook.class )
        .addAnnotatedClass( Dvd.class )
        .addAnnotatedClass( Book.class )
        .addAnnotatedClass( Nation.class )
        .build();
    FullTextSession fullTextSession = ftsb.openFullTextSession();
    SearchFactoryImplementor searchFactory = (SearchFactoryImplementor) fullTextSession.getSearchFactory();
    {
      TestableMassIndexerImpl tsii = new TestableMassIndexerImpl( searchFactory, Book.class );
      assertTrue( tsii.getRootEntities().contains( Book.class ) );
      assertFalse( tsii.getRootEntities().contains( ModernBook.class ) );
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

        .addAnnotatedClass( WeirdlyIdentifiedEntity.class )
        .setProperty( Environment.INDEXING_STRATEGY, "manual" )
        .build();
    {
      //creating the test data in database only:
      FullTextSession fullTextSession = ftsb.openFullTextSession();
      Transaction transaction = fullTextSession.beginTransaction();
      Nation us = new Nation( "United States of America", "US" );
      fullTextSession.persist( us );
      Dvd dvda = new Dvd();
      dvda.setTitle( "Star Trek (episode 96367)" );
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

      //verify index is still empty:
      assertEquals( 0, countResults( new Term( "title", "trek" ), ftsb, Dvd.class ) );
      assertEquals( 0, countResults( new Term( "id", "not" ), ftsb, WeirdlyIdentifiedEntity.class ) );
    }
    {
      FullTextSession fullTextSession = ftsb.openFullTextSession();
      fullTextSession.createIndexer( Dvd.class )
          .startAndWait();
      fullTextSession.close();
    }
    {
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

    {
      //verify index is now containing both DVDs:
      assertEquals( 2, countResults( new Term( "title", "trek" ), ftsb, Dvd.class ) );
    }
    {
      FullTextSession fullTextSession = ftsb.openFullTextSession();
      fullTextSession.createIndexer( WeirdlyIdentifiedEntity.class )
          .startAndWait();
      fullTextSession.close();
    }
    {
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

        .addAnnotatedClass( IssueEntity.class )
        .setProperty( Environment.INDEXING_STRATEGY, "manual" )
        .build();
    {
      //creating the test data in database only:
      FullTextSession fullTextSession = ftsb.openFullTextSession();
      Transaction transaction = fullTextSession.beginTransaction();
      ExtendedIssueEntity issue = new ExtendedIssueEntity();
      issue.jiraCode = "HSEARCH-977";
      issue.jiraDescription = "MassIndexer freezes when there is an indexed 'id' filed, which is not document's id";
      issue.id = 1l;
View Full Code Here

Examples of org.hibernate.search.test.util.FullTextSessionBuilder.openFullTextSession()

      //verify index is still empty:
      assertEquals( 0, countResults( new Term( "jiraDescription", "freezes" ), ftsb, ExtendedIssueEntity.class ) );
      assertEquals( 0, countResults( new Term( "jiraCode", "HSEARCH" ), ftsb, ExtendedIssueEntity.class ) );
    }
    {
      FullTextSession fullTextSession = ftsb.openFullTextSession();
      fullTextSession.createIndexer( ExtendedIssueEntity.class )
          .startAndWait();
      fullTextSession.close();
    }
    {
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.