-->
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.  [ 2 posts ] 
Author Message
 Post subject: Search with aggregate functions
PostPosted: Wed Jul 18, 2012 8:38 am 
Newbie

Joined: Mon Dec 19, 2005 9:18 pm
Posts: 17
Location: Brussels, Belgium
I have an Item entity like this:

Code:
@Entity
public class Item {
    @ToMany
    List<Comment> comments;
}


And I would like to search all items that have between 5 and 10 comments, or sort items that correspond to a keyword by decreasing number of comments.
Is it possible with Hibernate Search. How should I annotate and index my Item class? What should the query look like?

_________________
Sébastien Arbogast


Top
 Profile  
 
 Post subject: Re: Search with aggregate functions
PostPosted: Mon Jul 23, 2012 9:46 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

that is unfortunately not possible atm.
One way of achieving it indirectly, however, would be to index the collection size separately with a custom field/class bridge. Then you could use this field for your search.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.