Author Login
Post Reply
Author: hardy.ferentschik
Date: 2008-07-03 11:45:35 -0400 (Thu, 03 Jul 2008)
New Revision: 14846
Modified:
search/trunk/src/java/org/hibernate/search/event/FullTextIndexEventListener.java
search/trunk/src/test/org/hibernate/search/test/embedded/EmbeddedTest.java
search/trunk/src/test/org/hibernate/search/test/jms/master/JMSMasterTest.java
search/trunk/src/test/org/hibernate/search/test/perf/IndexTestDontRun.java
search/trunk/src/test/org/hibernate/search/test/perf/SearcherThread.java
search/trunk/src/test/org/hibernate/search/test/query/LuceneQuerySortTest.java
search/trunk/src/test/org/hibernate/search/test/query/LuceneQueryTest.java
search/trunk/src/test/org/hibernate/search/test/query/MultiClassesQueryLoaderTest.java
search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java
search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java
search/trunk/src/test/org/hibernate/search/test/query/TermVectorTest.java
search/trunk/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java
search/trunk/src/test/org/hibernate/search/test/reader/functionality/FilterOnDirectoryTest.java
search/trunk/src/test/org/hibernate/search/test/reader/performance/AbstractActivity.java
search/trunk/src/test/org/hibernate/search/test/session/MassIndexTest.java
search/trunk/src/test/org/hibernate/search/test/session/MassIndexUsingManualFlushTest.java
search/trunk/src/test/org/hibernate/search/test/session/OptimizeTest.java
search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java
search/trunk/src/test/org/hibernate/search/test/shards/ShardsTest.java
search/trunk/src/test/org/hibernate/search/test/similarity/SimilarityTest.java
Log:
HSEARCH-215
* First part of refactoring. Renamed org.hibernate.search.Search.createFullTextSession into getFullTextSession. Same might be required for org.hibernate.search.jpa.Search
Modified: search/trunk/src/java/org/hibernate/search/event/FullTextIndexEventListener.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/event/FullTextIndexEventListener.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/java/org/hibernate/search/event/FullTextIndexEventListener.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
*/
//TODO work on sharing the same indexWriters and readers across a single post operation...
//TODO implement and use a LockableDirectoryProvider that wraps a DP to handle the lock inside the LDP
+@(protected)")
public class FullTextIndexEventListener implements PostDeleteEventListener, PostInsertEventListener,
PostUpdateEventListener, Initializable, Destructible {
- @SuppressWarnings( { "WeakerAccess" } )
protected boolean used;
protected SearchFactoryImplementor searchFactoryImplementor;
@@(protected) @@
}
}
- @SuppressWarnings( { "WeakerAccess" } )
protected void processWork(Object entity, Serializable id, WorkType workType, AbstractEvent event) {
Work work = new Work(entity, id, workType);
searchFactoryImplementor.getWorker().performWork( work, event.getSession() );
Modified: search/trunk/src/test/org/hibernate/search/test/embedded/EmbeddedTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/embedded/EmbeddedTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/embedded/EmbeddedTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
import org.apache.lucene.search.TermQuery;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.event.PostCollectionRecreateEventListener;
-import org.hibernate.event.PostCollectionRemoveEventListener;
-import org.hibernate.event.PostCollectionUpdateEventListener;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
-import org.hibernate.search.event.FullTextIndexCollectionEventListener;
import org.hibernate.search.test.SearchTestCase;
/**
@@(protected) @@
protected void configure(org.hibernate.cfg.Configuration cfg) {
super.configure( cfg );
- FullTextIndexCollectionEventListener del = new FullTextIndexCollectionEventListener();
- //FIXME remove when depending on Annotations 3.3.1
- cfg.getEventListeners().setPostCollectionRecreateEventListeners( new PostCollectionRecreateEventListener[]{del} );
- cfg.getEventListeners().setPostCollectionUpdateEventListeners( new PostCollectionUpdateEventListener[]{del} );
- cfg.getEventListeners().setPostCollectionRemoveEventListeners( new PostCollectionRemoveEventListener[]{del} );
}
protected Class[] getMappings() {
Modified: search/trunk/src/test/org/hibernate/search/test/jms/master/JMSMasterTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/jms/master/JMSMasterTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/jms/master/JMSMasterTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
//wait for the message to be processed
Thread.sleep( 1000 );
- FullTextSession ftSess = Search.createFullTextSession( openSession( ) );
+ FullTextSession ftSess = Search.getFullTextSession( openSession( ) );
ftSess.getTransaction().begin();
QueryParser parser = new QueryParser( "id", new StopAnalyzer() );
Query luceneQuery = parser.parse( "logo:jboss" );
Modified: search/trunk/src/test/org/hibernate/search/test/perf/IndexTestDontRun.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/perf/IndexTestDontRun.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/perf/IndexTestDontRun.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
private IndexSearcher getNewSearcher() throws IOException {
final org.hibernate.classic.Session session = getSessions().openSession();
- Directory d = Search.createFullTextSession( session ).getSearchFactory().getDirectoryProviders( Boat.class )[0].getDirectory();
+ Directory d = Search.getFullTextSession( session ).getSearchFactory().getDirectoryProviders( Boat.class )[0].getDirectory();
IndexSearcher indexsearcher = new IndexSearcher( d );
return indexsearcher;
}
Modified: search/trunk/src/test/org/hibernate/search/test/perf/SearcherThread.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/perf/SearcherThread.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/perf/SearcherThread.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
try {
Query q = getQuery();
// Search
- FullTextSession ftSession = Search.createFullTextSession( sf.openSession( ) );
+ FullTextSession ftSession = Search.getFullTextSession( sf.openSession( ) );
final FullTextQuery textQuery = ftSession.createFullTextQuery( q, Boat.class )
.setMaxResults( 100 ).setProjection( "name" );
long start = System.currentTimeMillis();
Modified: search/trunk/src/test/org/hibernate/search/test/query/LuceneQuerySortTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/LuceneQuerySortTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/query/LuceneQuerySortTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
* @throws Exception in case the test fails.
*/
public void testList() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
createTestBooks(s);
Transaction tx = s.beginTransaction();
QueryParser parser = new QueryParser("title", new StopAnalyzer() );
Modified: search/trunk/src/test/org/hibernate/search/test/query/LuceneQueryTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/LuceneQueryTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/query/LuceneQueryTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
public class LuceneQueryTest extends SearchTestCase {
public void testList() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Clock clock = new Clock( 1, "Seiko" );
s.save( clock );
@@(protected) @@
}
public void testResultSize() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Clock clock = new Clock( 1, "Seiko" );
s.save( clock );
@@(protected) @@
}
public void testFirstMax() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Clock clock = new Clock( 1, "Seiko" );
s.save( clock );
@@(protected) @@
}
public void testIterator() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Clock clock = new Clock( 1, "Seiko" );
s.save( clock );
@@(protected) @@
}
public void testScrollableResultSet() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Clock clock = new Clock( 1, "Seiko" );
s.save( clock );
@@(protected) @@
// Technically this is checked by other tests but let's do it anyway. J.G.
public void testDefaultFetchSize() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testFetchSizeLargerThanHits() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testFetchSizeDefaultFirstAndMax() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testFetchSizeNonDefaultFirstAndMax() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testFetchSizeNonDefaultFirstAndMaxNoHits() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testCurrent() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testMultipleEntityPerIndex() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Clock clock = new Clock( 1, "Seiko" );
s.save( clock );
@@(protected) @@
}
public void testCriteria() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
@@(protected) @@
}
public void testScrollEmptyHits() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testListEmptyHits() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
@@(protected) @@
}
public void testIterateEmptyHits() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
s.clear();
Modified: search/trunk/src/test/org/hibernate/search/test/query/MultiClassesQueryLoaderTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/MultiClassesQueryLoaderTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/query/MultiClassesQueryLoaderTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
Statement statement = sess.connection().createStatement();
statement.executeUpdate( "DELETE FROM Author" );
statement.close();
- FullTextSession s = Search.createFullTextSession( sess );
+ FullTextSession s = Search.getFullTextSession( sess );
tx = s.beginTransaction();
QueryParser parser = new QueryParser( "title", new KeywordAnalyzer() );
Query query = parser.parse( "name:moo" );
Modified: search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
public class ProjectionQueryTest extends SearchTestCase {
public void testLuceneObjectsProjectionWithScroll() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
Transaction tx;
@@(protected) @@
}
public void testResultTransformToDelimString() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
Transaction tx;
@@(protected) @@
}
public void testResultTransformMap() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
Transaction tx;
@@(protected) @@
}
public void testLuceneObjectsProjectionWithIterate() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
Transaction tx;
@@(protected) @@
}
public void testLuceneObjectsProjectionWithList() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
prepEmployeeIndex( s );
Transaction tx;
@@(protected) @@
}
public void testProjection() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
Modified: search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/query/QueryLoaderTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
tx.commit();
sess.clear();
- FullTextSession s = Search.createFullTextSession( sess );
+ FullTextSession s = Search.getFullTextSession( sess );
tx = s.beginTransaction();
QueryParser parser = new QueryParser( "title", new KeywordAnalyzer() );
Query query = parser.parse( "title:moo" );
Modified: search/trunk/src/test/org/hibernate/search/test/query/TermVectorTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/query/TermVectorTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/query/TermVectorTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
public class TermVectorTest extends SearchTestCase {
public void testPositionOffsets() throws Exception {
- FullTextSession s = Search.createFullTextSession(openSession());
+ FullTextSession s = Search.getFullTextSession(openSession());
createIndex(s);
s.clear();
@@(protected) @@
public void testNoTermVector() throws Exception {
- FullTextSession s = Search.createFullTextSession(openSession());
+ FullTextSession s = Search.getFullTextSession(openSession());
Transaction tx = s.beginTransaction();
Employee e1 = new Employee(1000, "Griffin", "ITech");
Modified: search/trunk/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
catch (ParseException e) {
e.printStackTrace();
}
- return Search.createFullTextSession( s ).createFullTextQuery( luceneQuery );
+ return Search.getFullTextSession( s ).createFullTextQuery( luceneQuery );
}
}
@@(protected) @@
catch (ParseException e) {
e.printStackTrace();
}
- return Search.createFullTextSession( s ).createFullTextQuery( luceneQuery );
+ return Search.getFullTextSession( s ).createFullTextQuery( luceneQuery );
}
}
Modified: search/trunk/src/test/org/hibernate/search/test/reader/functionality/FilterOnDirectoryTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/reader/functionality/FilterOnDirectoryTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/reader/functionality/FilterOnDirectoryTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
public void testFilteredClasses() throws Exception {
createDoeFamily();
- FullTextSession fts = Search.createFullTextSession( openSession() );
+ FullTextSession fts = Search.getFullTextSession( openSession() );
Transaction tx = fts.beginTransaction();
Query q = new TermQuery( new Term( "name", "doe" ) );
Modified: search/trunk/src/test/org/hibernate/search/test/reader/performance/AbstractActivity.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/reader/performance/AbstractActivity.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/reader/performance/AbstractActivity.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
}
Session s = sf.openSession();
try {
- FullTextSession fts = Search.createFullTextSession( s );
+ FullTextSession fts = Search.getFullTextSession( s );
Transaction tx = s.beginTransaction();
boolean ok = false;
try {
Modified: search/trunk/src/test/org/hibernate/search/test/session/MassIndexTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/session/MassIndexTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/session/MassIndexTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
public class MassIndexTest extends SearchTestCase {
public void testBatchSize() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
int loop = 14;
for (int i = 0; i < loop; i++) {
@@(protected) @@
public void testTransactional() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
int loop = 4;
for (int i = 0; i < loop; i++) {
@@(protected) @@
tx.commit(); //do the process
s.close();
- s = Search.createFullTextSession( openSession() );
+ s = Search.getFullTextSession( openSession() );
tx = s.beginTransaction();
//object never indexed
Email email = (Email) s.get( Email.class, Long.valueOf( loop + 1 ) );
@@(protected) @@
s.close();
s = openSession();
- FullTextSession session = Search.createFullTextSession( s );
+ FullTextSession session = Search.getFullTextSession( s );
Query luceneQuery = new TermQuery( new Term( "categorie.nom", "livre" ) );
List result = session.createFullTextQuery( luceneQuery, Entite.class ).list();
assertEquals( 1, result.size() );
@@(protected) @@
s = openSession();
ent = (Entite) s.get( Entite.class, ent.getId() );
- session = Search.createFullTextSession( s );
+ session = Search.getFullTextSession( s );
session.index( ent );
s.close();
s = openSession();
- session = Search.createFullTextSession( s );
+ session = Search.getFullTextSession( s );
luceneQuery = new TermQuery( new Term( "categorie.nom", "livre" ) );
result = session.createFullTextQuery( luceneQuery, Entite.class ).list();
assertEquals( "test lazy loading and indexing", 1, result.size() );
@@(protected) @@
s = openSession();
Iterator it = s.createQuery( "from Entite where id = :id").setParameter( "id", ent.getId() ).iterate();
- session = Search.createFullTextSession( s );
+ session = Search.getFullTextSession( s );
while ( it.hasNext() ) {
ent = (Entite) it.next();
session.index( ent );
@@(protected) @@
s.close();
s = openSession();
- session = Search.createFullTextSession( s );
+ session = Search.getFullTextSession( s );
luceneQuery = new TermQuery( new Term( "categorie.nom", "livre" ) );
result = session.createFullTextQuery( luceneQuery, Entite.class ).list();
assertEquals( "test lazy loading and indexing", 1, result.size() );
Modified: search/trunk/src/test/org/hibernate/search/test/session/MassIndexUsingManualFlushTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/session/MassIndexUsingManualFlushTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/session/MassIndexUsingManualFlushTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
*/
public class MassIndexUsingManualFlushTest extends SearchTestCase {
public void testManualIndexFlush() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
int loop = 14;
for (int i = 0; i < loop; i++) {
Modified: search/trunk/src/test/org/hibernate/search/test/session/OptimizeTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/session/OptimizeTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/session/OptimizeTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
public class OptimizeTest extends SearchTestCase {
public void testOptimize() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession() );
+ FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
int loop = 2000;
for (int i = 0; i < loop; i++) {
@@(protected) @@
tx.commit();
s.close();
- s = Search.createFullTextSession( openSession() );
+ s = Search.getFullTextSession( openSession() );
tx = s.beginTransaction();
s.getSearchFactory().optimize( Email.class );
tx.commit();
Modified: search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
wrapper
);
try {
- Search.createFullTextSession( wrapped );
+ Search.getFullTextSession( wrapped );
}
catch( ClassCastException e ) {
e.printStackTrace( );
@@(protected) @@
}
public void testDetachedCriteria() throws Exception {
- FullTextSession s = Search.createFullTextSession( openSession( ) );
+ FullTextSession s = Search.getFullTextSession( openSession( ) );
DetachedCriteria dc = DetachedCriteria.forClass( Email.class );
try {
Criteria c = dc.getExecutableCriteria( s ).setMaxResults( 10 );
Modified: search/trunk/src/test/org/hibernate/search/test/shards/ShardsTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/shards/ShardsTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/shards/ShardsTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
s.clear();
tx = s.beginTransaction();
- FullTextSession fts = Search.createFullTextSession( s );
+ FullTextSession fts = Search.getFullTextSession( s );
QueryParser parser = new QueryParser("id", new StopAnalyzer() );
List results = fts.createFullTextQuery( parser.parse( "name:mouse OR name:bear" ) ).list();
@@(protected) @@
}
tx = s.beginTransaction();
- FullTextSession fts = Search.createFullTextSession( s );
+ FullTextSession fts = Search.getFullTextSession( s );
QueryParser parser = new QueryParser("id", new StopAnalyzer() );
List results = fts.createFullTextQuery( parser.parse( "name:mouse OR name:bear" ) ).list();
Modified: search/trunk/src/test/org/hibernate/search/test/similarity/SimilarityTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/similarity/SimilarityTest.java 2008-07-03 12:41:06 UTC (rev 14845)
+++ search/trunk/src/test/org/hibernate/search/test/similarity/SimilarityTest.java 2008-07-03 15:45:35 UTC (rev 14846)
@@(protected) @@
tx = s.beginTransaction();
TermQuery tq = new TermQuery( new Term("name", "green") );
- FullTextSession fts = Search.createFullTextSession( s );
+ FullTextSession fts = Search.getFullTextSession( s );
List results = fts.createFullTextQuery( tq, Trash.class ).setProjection( FullTextQuery.SCORE, FullTextQuery.THIS ).list();
assertEquals( 2, results.size() );
assertEquals( "Similarity not overridden at the class level", ( (Object[]) results.get( 0 ) )[0], ( (Object[]) results.get( 1 ) )[0]);
_______________________________________________
hibernate-commits mailing list
hibernate-commits@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-commits