-->
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: Combine HQL and Hibernate Search
PostPosted: Mon Apr 25, 2011 10:03 am 
Newbie

Joined: Tue Feb 08, 2011 10:05 am
Posts: 13
Hello
I've got standart HQL query. Suppose this query returns 1% of all rows. Then I need to make fulltext search (Hibernate Search) on the result of HQL. How can I make it?


Top
 Profile  
 
 Post subject: Re: Combine HQL and Hibernate Search
PostPosted: Mon Apr 25, 2011 10:21 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
I'm sorry that's not supported , as there is no way to solve such a requirement efficiently by Hibernate Search; there are however ways around it, but require some tricks from your part.

what you would need to do is load the entities you need via HQL and intersect the resultset with what you find via a FullText query.

Usually you should try to put in the index some additional metadata so that you can solve the query only via the index and avoid this limitation altogether.

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


Top
 Profile  
 
 Post subject: Re: Combine HQL and Hibernate Search
PostPosted: Mon Apr 25, 2011 10:42 am 
Newbie

Joined: Tue Feb 08, 2011 10:05 am
Posts: 13
Thank you

Do you have any statistic which solution is preferred to use in which cases?

My collection to be limited is less then 0.1% of all rows, HQL has about 3-5 restriction conditions


Top
 Profile  
 
 Post subject: Re: Combine HQL and Hibernate Search
PostPosted: Mon Apr 25, 2011 11:06 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
you should try index the fields you need to apply those restrictions

_________________
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.