-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Alternative to FullTextEntityManager.flushToIndexes (3.0.1)
PostPosted: Thu Sep 02, 2010 6:07 am 
Newbie

Joined: Sat Aug 28, 2010 10:37 am
Posts: 6
Hi,

it seems to me that I have to use Hibernate Search 3.0.1 because we're using JBoss 4.2.3/Hibernate Core 3.2.4.
Unfortunately I could neither find MassIndexer nor FullTextEntityManager.flushToIndexes there. How should I perform an effective index rebuild then? Any alternatives?


Thanks!


Top
 Profile  
 
 Post subject: Re: Alternative to FullTextEntityManager.flushToIndexes (3.0.1)
PostPosted: Thu Sep 02, 2010 10:01 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

Mass indexing and flush to index is indeed not available in 3.0.1 of Search. Best bet is to use the "old" recommended way of indexing using a scrollable result set - see batch indexing.

Personally, I would try to upgrade the Hibernate Core and Search dependencies. Unless there are any special reasons not to ;-)

--Hardy


Top
 Profile  
 
 Post subject: Re: Alternative to FullTextEntityManager.flushToIndexes (3.0.1)
PostPosted: Mon Sep 06, 2010 9:20 am 
Newbie

Joined: Sat Aug 28, 2010 10:37 am
Posts: 6
To test indexing/searching I'm in need of something like flushToIndexes(), too.

The transaction must be rolled back within my test infrastructure. Thus, I'm not able to get any search results due to the missing commit.

Is there a way to trigger the Lucene worker to flush changes to the index?
I've tried:
Code:
      
SearchFactoryImplementor searchFactoryImpl = ContextHelper.getSearchFactory((Session)getIndexEntityManager().getDelegate());
searchFactoryImpl.getWorker()... //flushToIndexes() is not available there


Top
 Profile  
 
 Post subject: Re: Alternative to FullTextEntityManager.flushToIndexes (3.0.1)
PostPosted: Mon Sep 06, 2010 9:43 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

you could use asynchronous indexing see the hibernate.search.worker.execution property. I personally would, however, just commit your test data. In production you probably also work in synchronous work and you want to keep test and production environment as close as possible. Why do you need to rollback? Can you not just commit the data and then in a tearDown step make sure that the database and index gets reset? This is how we do our testing within Hibernate Search as well. We use in memory databases and Lucene directory provider which make it even easier to build a clean test harness.

We had this question about transaction rollbacks only recently on the forum and it always comes down to implementing a suitable test harness framework.

--Hardy


Top
 Profile  
 
 Post subject: Re: Alternative to FullTextEntityManager.flushToIndexes (3.0.1)
PostPosted: Tue Sep 07, 2010 4:42 am 
Newbie

Joined: Sat Aug 28, 2010 10:37 am
Posts: 6
@hardy.ferentschik:
Thank you once again. It worked in my test environment when using asynchronous indexing. I only had to ensure that hibernate-search*.jar appears in classpath before hibernate-annotations*.jar and register event listeners manually.
However, in JBoss environment I didn't get it to work. Finally, I tried upgrading Hibernate as you recommended, see here: https://forum.hibernate.org/viewtopic.php?f=1&t=1006874.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.