-->
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: Projection + Sort = OutOfMemoryError?
PostPosted: Tue Apr 23, 2013 12:04 pm 
Newbie

Joined: Thu Apr 28, 2011 10:16 am
Posts: 3
Hello everyone!

I'm using Projection to search on an index with +/-6 millions records. When I don't sort the result, everything works fine. When I try to sort the result, I get an OutOfMemoryException.

The code is:
Code:
FullTextQuery fullTextQuery = fullTextEntityManager.createFullTextQuery(query, Record.class);
Sort sort = new Sort(new SortField("titles_store", 3,true));
fullTextQuery.setSort(sort);
fullTextQuery.setFirstResult(0);
fullTextQuery.setMaxResults(10);
/* some faceting request */
List resultProjection = fullTextQuery.setProjection("id","titles_store","descriptions_store","creators_store","dates","link","imageLink_store","archive.name","archive.homePageUrl").getResultList();


Without the lines
Code:
Sort sort = new Sort(new SortField("titles_store", 3,true));
fullTextQuery.setSort(sort);
, everything works fine.

With the lines
Code:
Sort sort = new Sort(new SortField("titles_store", 3,true));
fullTextQuery.setSort(sort);

, the getResultList() call throws an OutOfMemoryException...

The facets are not the problem (when disabled, the OutOfMemoryError occurs).
The query is a little complex, but I don't think it's the reason of the OutOfMemoryError (without sorting, with the same query, i get the results in less than a second...)
It seems that when using projection, the maxResults limit is not used and all the records are returned... I'm using Hibernate Search 3.4.2 Final. Any ideas?


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.