You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Gimantha Bandara <gi...@wso2.com> on 2016/03/15 12:04:21 UTC

How to get the top facets values of a field/dimension which has the highest number of immediate children

Hi,

Lets say I have thousands of Lucene documents which have a FacetField which
has the format of the following.

doc.add(new FacetField("Category", "level0", "level1", "level2", "level3",
...));

"Category" is the dimension name. "level0" represents the first
hierarchical level, "level1" represents the second hierarchical level of
"level0" (or the immediate children of "level0") and so on.. How do I get
the top "level0" values of "Category" which will have highest number of
unique "level1" values along with the unique "level1" count?

Thanks,
Gimantha