-->
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: Limit results in full text search query
PostPosted: Mon Oct 10, 2011 6:50 am 
Newbie

Joined: Sat May 01, 2010 10:20 am
Posts: 4
Hi,

We are using PostGres and hibernate Search. Doing some load testing, I do a full text search on the data, and I expect about 60 000 results from the Lucene search. When Hibernate passes these results from the search query to the Jpa query as an "in('1', '2', '3', ...)" sql query, PostGres doesn't like the fact that there are 60 000 parameters in the list. Which is quite normal of course.

My question is, how can I limit the list of ids in the list passed to the Jpa query?

Thanks in advance,
Michael


Top
 Profile  
 
 Post subject: Re: Limit results in full text search query
PostPosted: Mon Oct 10, 2011 9:57 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
right the default loading strategy is not appropriate for large result sets.

We expect most use cases to use pagination, as with

Code:
org.hibernate.Query.setMaxResults(int)
org.hibernate.Query.setFirstResult(int)


often used in combination with
Code:
org.hibernate.search.FullTextQuery.getResultSize()

which provides an estimate of the full match size without actually loading them.

If you're sure you need to process all results, did you consider using instead the scrollable API ? because if you're not adding any boundary to the query you might get in out of memory too.

Also have a look into
Code:
org.hibernate.search.FullTextQuery.initializeObjectsWith(ObjectLookupMethod, DatabaseRetrievalMethod)

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


Top
 Profile  
 
 Post subject: Re: Limit results in full text search query
PostPosted: Tue Oct 18, 2011 7:21 am 
Newbie

Joined: Sat May 01, 2010 10:20 am
Posts: 4
Hi Sanne,

Thanks, I will give that a shot!

Kind regards,
Michael


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.