-->
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: Pagination not working in FullTextEntityManager
PostPosted: Thu Mar 24, 2016 5:12 am 
Beginner
Beginner

Joined: Mon Jul 27, 2015 4:03 am
Posts: 29
I am using 4.2.0.Final. When the lucene indexes are out of sync with database entries (as a result of direct dml operations) , this code works fine --

Code:
FullTextEntityManager ftem = org.hibernate.search.jpa.Search.getFullTextEntityManager(entityManager);
FullTextQuery jpaQuery = ftem.createFullTextQuery(query, clazz);

List<T> result = jpaQuery.getResultList();


I get correct result set.

However, the following code with pagination properties doesn't work --

Code:
FullTextEntityManager ftem = org.hibernate.search.jpa.Search.getFullTextEntityManager(entityManager);
FullTextQuery jpaQuery = ftem.createFullTextQuery(query, clazz);
jpaQuery.setFirstResult(11);
jpaQuery.setMaxResults(10);
List<T> result = jpaQuery.getResultList();


The result set is null. Wanted to confirm if this is expected behavior. There may be occasional sync issues with the indexes.

Thanks,
Rajesh


Top
 Profile  
 
 Post subject: Re: Pagination not working in FullTextEntityManager
PostPosted: Thu Mar 24, 2016 10:43 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi Rajesh,

do you mean that result is null ? Or that the result elements of the List are null? Is there any exception logged?

version 4.2 is very old, please upgrade! It is possible that you're affected by some bug which was fixes so long ago that I forgot about it.

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


Top
 Profile  
 
 Post subject: Re: Pagination not working in FullTextEntityManager
PostPosted: Thu Mar 24, 2016 11:59 am 
Beginner
Beginner

Joined: Mon Jul 27, 2015 4:03 am
Posts: 29
I am so sorry. I should have clarified while asking the question. The result list is NOT null. The size of the list is ZERO .

I am planning to pick 5.0 Beta. I'll run my tests and report back.


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.