-->
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 Index file creation
PostPosted: Mon Apr 09, 2007 3:44 am 
Newbie

Joined: Mon Apr 09, 2007 3:20 am
Posts: 5
Location: Colombo
Hi all,

I'm very new to Hibernate search this is the first time I'm going to work with hibernate search. I have some experience in Hibernate.
The problem is like this.
I have configured the hibernate search with my .ear and annotated entity beans with the relevant annotations which are provided in the reference documentation.


This is the property configuration part in persistence.xml

Code:
[b]<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
   <property name="hibernate.search.default.indexBase" value="D:\HibernateSearch\indexes"/> [/b]


This is my entity bean (I included only the fields which are annotated for Hibernate Search)

Code:
@Entity
@Indexed(index="tblHotels")
@Role(name="roomsnet.r5.pojo.portal.TblHotels_hotelToBeMapped")
@Name("roomsnet.r5.pojo.portal.TblHotels")
@Table(name = "TBL_HOTELS", uniqueConstraints = {})
public class TblHotels implements java.io.Serializable {
....
....
....

@Column(name = "HOT_NAME", unique = false, nullable = false, insertable = true, updatable = true, length = 2000)
   @Field(name="HotelName", index=Index.TOKENIZED, store=Store.YES)
   public String getHotName() {
      return this.hotName;
   }

@Column(name = "HOT_DES", unique = false, nullable = true, insertable = true, updatable = true, length = 1500)
   @Field(name="HotelDes", index=Index.TOKENIZED, store=Store.YES)
   public String getHotDes() {
      return this.hotDes;
   }
}



1. I'm not doing any insert, update, delete records from the database using the entity bean. I do only the SELECT because in this application user search for hotels and we are returning the list of hotels according to the search word. It returns as the list of TblHotels objects. Can I use Hibernate Search for such a scenario?

2. I have tried as mentioned in the Hibernate documentation but no indexes are created in the specified directory?

Please help me on this matter. Really appreciate your help.

Thanks and Regards
Lakshitha


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 6:02 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
move your question to http://forum.hibernate.org/viewforum.php?f=9, this is the dedcated forum.
Quick answer for your question, yes it's possible but you need to initially index your data.
fullTextSession.index(myObject); is a solution.

And everytime a third party app update the db, you need to run ftSession.index on the modified objects (of course if the change is done by hibernate, just use Hibernate Search, and the changes will be propagated transparently).

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 8:26 am 
Newbie

Joined: Mon Apr 09, 2007 3:20 am
Posts: 5
Location: Colombo
Thanks a lot Emanuel, I'll try out as you said and I hope I can manage that.


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.