-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Search-populating lucene index from database
PostPosted: Mon Dec 28, 2009 10:59 am 
Beginner
Beginner

Joined: Wed Dec 16, 2009 10:34 am
Posts: 21
Hello there:

In the Hibernate Search tutorial "1.4. Indexing ", there is a code to populate the lucene index from a database.
My question is..... Where do i have to put that code ?.
In a session bean with a certain method executed right after the web application starts?

I'll appreciate the help.


Top
 Profile  
 
 Post subject: Re: Hibernate Search-populating lucene index from database
PostPosted: Mon Dec 28, 2009 12:16 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi kmilo,
it depends on you application :-) Usually indexes are stored on filesystem (you might have configured it differently) so when your application restarts you don't need to reindex your database.
You mention session beans so I guess we're talking about EJBs?
If you know the database, schema, or application mapping changed after a redeploy then yes you should reindex the database; otherwise it's not needed.
In a similar situation I had created an MBean to reindex it all, so I could have the application server admin reindex the database as needed; a Session bean could do the same job, but there are situations in which you don't want to reindex it all: it might be a time-consuming task.

BTW there's a new reindexing routine in the latest beta: http://in.relation.to/Bloggers/HibernateSearch32FastIndexRebuild
but yet again when you want to start it, that's up to your needs.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Hibernate Search-populating lucene index from database
PostPosted: Mon Dec 28, 2009 5:29 pm 
Beginner
Beginner

Joined: Wed Dec 16, 2009 10:34 am
Posts: 21
Thank you !!
Right now, I'm using a method in the MBean constructor that populate the lucene index. (This could be wrong, but im just testing hibernate search).
Thank you for answer (you probably don't know how hard is to find help in a support forum).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.