Consider:
@Indexed
@Entity
public class TParent implements java.io.Serializable {
.....
private Set<TChild> TChildSet = new HashSet<TChild>(0);
@ContainedIn
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="TParent")
public Set<TChild> getTChildSet() {
return this.TChildSet;
}
A query would be something like this:
FullTextQuery hibQuery = fullTextSession.createFullTextQuery( luceneQuery );
hibQuery.setSort( ... )
How can a sort-by-child-count be achieved?
In other words, the order of the TParent list returned would be dictated by the TChildSet count.
I know an @Formula can be used in SQL circumstances. I'm not sure if something similar can be used for Lucene?
Any help, pointers, comments even critique welcome.
Thanks Very Much John