-->
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: hibernate search: sql query and lucene query
PostPosted: Mon Feb 18, 2008 8:57 am 
Newbie

Joined: Mon Feb 18, 2008 8:51 am
Posts: 3
Hi,

I would like to understand if I can "mix" query.
for example:

imagine a table "student" with id, first name, last name, year of birth.. ecc

and another table "homework" with studentId, date, exercise text..

may I query the sistem for all the homework containing the word "napoleon" of all the students whose name is "mike" ??

how?
shall I ask hib_search to index first name, last name, ecc too? and what about performance?

Any help will be really appreciated.


Top
 Profile  
 
 Post subject: Yes. It is possible. You can peacefully do that
PostPosted: Tue Feb 19, 2008 8:30 am 
Newbie

Joined: Tue Feb 12, 2008 5:15 am
Posts: 3
Yes you can peacefully do that. Look at this example.

Chapter 4. Mapping entities to the index structure

http://www.hibernate.org/hib_docs/searc ... ml_single/

Especially you can go through this section (4.1.3. Embedded and associated objects)thorougjhly. Nice example. And it works great.


Top
 Profile  
 
 Post subject: Re: Yes. It is possible. You can peacefully do that
PostPosted: Tue Feb 19, 2008 9:11 am 
Newbie

Joined: Mon Feb 18, 2008 8:51 am
Posts: 3
in your example both ends of "place-addresses" association are indexed. (ie +name:jboss +address.city:atlanta both name and address.city are indexed fileds)

what if I can't mark as indexed filed any filed of students, as regard my former example, or addresses??


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 19, 2008 8:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You must mark them as indexed. wrt performance, I dont' think you will have any issue, especially since this is a @MAnyToOne

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 20, 2008 4:54 am 
Newbie

Joined: Mon Feb 18, 2008 8:51 am
Posts: 3
thank you so much!
see you!


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.