s = Search.getFullTextSession( openSession() );
tx = s.beginTransaction();
parser = new QueryParser( TestConstants.getTargetLuceneVersion(), "id", TestConstants.stopAnalyzer );
result = s.createFullTextQuery( parser.parse( "body:write" ) ).list();
assertEquals( 0, result.size() );
result = s.createCriteria( Email.class ).list();
for ( int i = 0; i < loop / 2; i++ ) {
s.index( result.get( i ) );
}
tx.commit(); //do the process
s.index( result.get( loop / 2 ) ); //do the process out of tx