Package org.hibernate.search

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


    englishArticle.setText( "acknowledgment" );
    englishArticle.setReferences( references );

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    s.persist( englishArticle );
    tx.commit();

    tx = s.beginTransaction();

    // at query time we use a standard analyzer. We explicitly search for tokens which can only be found if the
View Full Code Here


public class ExplanationTest extends SearchTestCase {
  public void testExplanation() throws Exception {
    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    Dvd dvd = new Dvd("The dark knight", "Batman returns with it best enomy the Jocker. The dark side of this movies shows up pretty quickly");
    s.persist( dvd );
    dvd = new Dvd("Wall-e", "The tiny little robot comes to Eartch after the dark times and tries to clean it");
    s.persist( dvd );
    tx.commit();
    s.clear();
View Full Code Here

    FullTextSession s = Search.getFullTextSession( openSession() );
    Transaction tx = s.beginTransaction();
    Dvd dvd = new Dvd("The dark knight", "Batman returns with it best enomy the Jocker. The dark side of this movies shows up pretty quickly");
    s.persist( dvd );
    dvd = new Dvd("Wall-e", "The tiny little robot comes to Eartch after the dark times and tries to clean it");
    s.persist( dvd );
    tx.commit();
    s.clear();

    tx = s.beginTransaction();
    Map<String, Float> boosts = new HashMap<String, Float>(2);
View Full Code Here

    for (int i = 0; i < loop; i++) {
      Email email = new Email();
      email.setId( (long) i + 1 );
      email.setTitle( "JBoss World Berlin" );
      email.setBody( "Meet the guys who wrote the software" );
      s.persist( email );
    }
    tx.commit();
    s.close();

    s = Search.getFullTextSession( openSession() );
View Full Code Here

    emailAddress.setDefaultAddress(true);

    person.addEmailAddress( emailAddress );

    // persist the customer
    s.persist( person );
    tx.commit();

    // search if the record made it into the index
    tx = s.beginTransaction();
    String searchQuery = "Joe";
View Full Code Here

    for (int i = 0; i < loop; i++) {
      Email email = new Email();
      email.setId( (long) i + 1 );
      email.setTitle( "JBoss World Berlin" );
      email.setBody( "Meet the guys who wrote the software" );
      s.persist( email );
    }
    tx.commit();
    s.close();

    //check non created object does get found!!1
View Full Code Here

    FullTextSession fullTextSession = Search.getFullTextSession( sessions.openSession() );
    Transaction tx = fullTextSession.beginTransaction();
    for (int i=0; i<number; i++ ) {
      BusLine line = new BusLine();
      line.setBusLineName( "line " + i );
      fullTextSession.persist( line );
    }
    if ( rollback ) {
      tx.rollback();
    }
    else {
View Full Code Here

    FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
    Transaction tx = fullTextSession.beginTransaction();
    for ( int i = 0; i < number; i++ ) {
      BusLine line = new BusLine();
      line.setBusLineName( "line " + i );
      fullTextSession.persist( line );
    }
    if ( rollback ) {
      tx.rollback();
    }
    else {
View Full Code Here

    FullTextSession session = builder.openFullTextSession();
    Transaction transaction = session.beginTransaction();

    // need to index at least two instances. In the single instance case a search will not go via the object initializer
    Foo foo = new Foo();
    session.persist( foo );
    Foo snafu = new Foo();
    session.persist( snafu );

    transaction.commit();
    session.close();
View Full Code Here

    // need to index at least two instances. In the single instance case a search will not go via the object initializer
    Foo foo = new Foo();
    session.persist( foo );
    Foo snafu = new Foo();
    session.persist( snafu );

    transaction.commit();
    session.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.