| As of why it works with BigDecimal, I'll take a look but I'm pretty sure it's related to low level Lucene and not really relevant to this discussion. What you have to understand is that @IndexEmbedded does not create sub documents so basically, you end up having in your index a document like this:
PromotionTemplate
id = 1
organizationStatistics.id=4 / 5 / 6
organizationStatistics.views=5678 / 9888 / 7558
So when you search on organizationStatistics.id, you get the whole PromotionTemplate document and when you try to order on organizationStatistics.views, you have a multivalued field and you can't really sort on it. Do you understand why it does not work? |