| Thanks for the information. So the error message is not really helpful but the problem is that you are trying to sort on a multivalued field which does not really make sense. What you should do is add a transient method in PromotionTemplate which will build the sort field (either using a sum, a min, a max... depending on your business use case). Based on what I see of your business case, I suppose a sum would be in order. Something along the lines of:
@Field
@Transient
public Long getViewsSort() {
Long result = null;
for (element in organizationStatistics) {
your business logic
}
return your long;
}
Can you try this and see how it goes? |