-->
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: Idiom for using FullTextQueryImpl with paginatination
PostPosted: Fri Jan 12, 2007 11:07 am 
Newbie

Joined: Fri Jan 12, 2007 10:44 am
Posts: 2
I have begun using Hibernate Search (3.2.1 GA)...very sweet.

One issue I encountered was the use of FullTextQueryImpl#resultSize() with pagination.

I would like to obtain the hits count (with #resultSize()) to present to the ui (with #setFirstResult(int) and friends for the pagination).

Should I use #scroll() for initialising the resultSize, and then subsequently call #setFirstResult(int),...#list() for the results?

many thanks,
ian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 11:21 am 
Newbie

Joined: Fri Jan 12, 2007 10:44 am
Posts: 2
Apologies, just browsed http://www.hibernate.org/hib_docs/annotations/reference/en/html/lucene.html once more. It has the following...

Quote:
If you wish to minimize Lucene document loading, scroll() is more appropriate, Don't forget to close the ScrollableResults object when you're done, since it keeps Lucene resources.

I will go ahead and use scroll().

thanks,
ian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 8:21 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
yes, scroll is what you want.
I should probably introduce some sort of scroll fetch_size to load objects by batch in this case.

_________________
Emmanuel


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.