-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Search
PostPosted: Sat Jul 19, 2008 4:07 am 
Beginner
Beginner

Joined: Mon Oct 01, 2007 8:21 am
Posts: 40
Hi,

Im doing with the Hibernate search not able to index properly, i don no wht could b the porblem, pls any body could go through it and tell me what could b the prob.


@Entity
@Indexed
class EventDb{
@IndexedEmbedded(prefix="EvtSessionInfo_", depth=2)
private List<EvtSessionInfo> evtSessionInfos = new ArrayList<EvtSessionInfo>(0);
}

@Entity
@Indexed
class EvtSessionInfo{
@IndexedEmbedded(prefix="hallMeetingRoom_", depth =1)
private HallMeetingRoom hallMeetingRoom;

@NaturalId
@ContainedIn
private EventDb eventDb;

}

@Entity
@Indexed
class HallMeetingRoom{
@Field(index=Index.TOKENIZED, store=Store.NO)
private String hallMeetingRoomName;
}

Im making the index of EventDb like this
Code:
try {
   Session session = null;
     SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
     session =sessionFactory.openSession();
   FullTextSession fullTextSession = Search.createFullTextSession(session);
   

   List<EventDb> eventDbTx = session.createQuery("from EventDb").list();
   for(EventDb eventDbTx1 : eventDbTx){
      System.out.println("Inside Creating Index........");
      fullTextSession.index(eventDbTx1);
   }
   
   session.close();
   } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
   }



In the above index EventSessionInfo has the bidirectional approach to EventDb and HallMeetingRoom doesn't have a bidirectional approach to EventSessionInfo. I don no whether this is making any problem or depth is making prob, i feel depth is proper.

When i open the EventDb index im able to eventSessionInfo and not the HallMeetingRoom info.

Any other proper way to handle this.

Could anyone come up on this, to solve my issue.

Thanks,
Ambika☺


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 23, 2008 3:47 am 
Hibernate Team
Hibernate Team

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

Are this the complete entities you are posting? For example I cannot see @DocumentId in EventDb. Maybe you could provide the full mapping for this class. Also, how does your hibernate configuration file look like?

Have you read through the Getting Started section (http://www.hibernate.org/hib_docs/search/3.1.0.Beta1/reference/en/html_single/#getting-started) of the online documentation? I recommend starting with a very simple example to verify that everything is working and then extending from there.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 1:36 am 
Beginner
Beginner

Joined: Mon Oct 01, 2007 8:21 am
Posts: 40
Thanks Hardy,

No.. the one which i have posted is not the complete entities, i have gone through that online doc.. i just asked like if there is nested POJO, like the which i have posted, will that work without bidirectional relation because from Class hallMeetingRoom i don't have the bidirectional relation to EvtSessionInfo.

Index is properly created till EvtSessionInfo.

Any idea what could b the reason for this kind of Entities.

Thanks,
Ambika☺


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 28, 2008 12:29 pm 
Hibernate Team
Hibernate Team

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

Not having a bidirectional relationship should not cause a problem. However, without a bidirectional relationship you won't get index updates when the embedded entities change. Check the online docs for that.

--Hardy


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