-->
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.  [ 1 post ] 
Author Message
 Post subject: SetMaxResults doesn't work with FullTextQuery with Criteria
PostPosted: Mon Dec 15, 2008 6:23 am 
Newbie

Joined: Wed Sep 03, 2008 7:20 am
Posts: 3
I'm trying to do the same query...


Code:
          Criteria c = filter.processCriteria(fullTextSession.createCriteria(Page.class,"p"));
          
           Criteria c2 = filter.processCriteria(fullTextSession.createCriteria(Page.class));
          
           
           
           total = fullTextSession.createFullTextQuery(luceneQuery)
          .setCriteriaQuery(c2).list().size();
           
           List pages = fullTextSession
         .createFullTextQuery(luceneQuery)
         .setCriteriaQuery(c)
         .setFirstResult(startIndex-1)
         .setMaxResults(count)
         .list();


I'm really surprised of this, because if I remove setCriteriaQuery from the Query, setMaxResults works properly, but If I keep it, the resultset was cut at count-1 elements...

The total resultset size is 10, and I put startIndex to 1, count = 6, and the queries return two pages of results with 5 elements each one...

Can anybody help??

Thank you in advance[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.