I am using Hibernate 4 along with lucene 3.6. I have a requirement related to facet count. In my requirement I have an entity "Product". Entity "Product" has some property for example id, color, brand.
Now my requirement is that I want to get facet count for this entity in multidimension, get count for red(color) nike(brand) apparel.
So take a example. I have following product entities saved in my database.
id brand color
1 reebok red
2 reebok black
3 reebok green
4 Lee red
5 Lee black
6 Lee black
Now I want my code to take atleast two parameters(i.e. firstGroupBy, secondGroupBy) which are "brand" and "color" in this case and return results as below
reebok(3)
reebok red(1)
reebok black(1)
reebok green(2)
Lee(3)
Lee red(1)
Lee black(2)
Is it possible to do it in hibernate 4? If yes then how can I do this?
Following url explains how to do
http://www.hascode.com/2012/03/hibernate-search-faceting-discrete-and-range-faceting-by-example/
Hope it helps