-->
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: Search with associations
PostPosted: Fri Apr 08, 2011 6:41 am 
Newbie

Joined: Fri Apr 08, 2011 6:24 am
Posts: 9
Hi,
I want to use HSearch in advanced search in my app. I have a problem with many associated entities:
I have entity apartment, which contains some attributes and some associations.
Searching with apartment's attribute is easy but I don't know how I should search against associated objects.

apartment{
OneToMany Rooms
OneToMany Equipment
OneToMany Properties
OneToMany Reservations
and some other.
}

And my problem is: I want to search apartments, which desriptions/name/city/region contains some text, and they have some rooms, and some equipments, and some properites and apartment is free with given date or range of dates (reservations)

And I should make index with all data, or make index from basic attributes (name,description), search with given attributes, get result (apartment id) and make another hibernate query for associated objects with IN clausule?

Apartment and its associated objects will change rarely, except reservations.


Top
 Profile  
 
 Post subject: Re: Search with associations
PostPosted: Fri Apr 08, 2011 6:59 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi, welcome.
did you see the documentation about @IndexedEmbedded ? it will walk down the refences to the other objects and index the other fields it finds.

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


Top
 Profile  
 
 Post subject: Re: Search with associations
PostPosted: Fri Apr 08, 2011 7:14 am 
Newbie

Joined: Fri Apr 08, 2011 6:24 am
Posts: 9
yes:) I don't know what is the good way to do what I want. Except reservations all associations may be in index. reservations will change often, so hsearch would rebuild indexes often too.


Top
 Profile  
 
 Post subject: Re: Search with associations
PostPosted: Fri Apr 08, 2011 7:21 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
it's not going to rebuild the full index, only the document relevant to the apartment you change. It shouldn't be a performance problem, I'd try it first and see how it goes. There are many performance-improving options you can tune when you have a good lead test.

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


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.