Because the number of selected children of each node is restricted, and not the overall number of nodes in the {@link FacetResult}, facets not selected into {@link FacetResult} might have better values, or ordinals, (typically,higher counts), than facets that are selected into the {@link FacetResult}.
The generated {@link FacetResult} also provides with{@link FacetResult#getNumValidDescendants()}, which returns the total number of facets that are descendants of the root node, no deeper than {@link FacetRequest#getDepth()}, and which have valid value. The rootnode itself is not counted here. Valid value is determined by the {@link FacetResultsHandler}. {@link TopKInEachNodeHandler} defines valid as!= 0.
NOTE: this code relies on the assumption that {@link TaxonomyReader#INVALID_ORDINAL} == -1, a smaller value than any validordinal. @lucene.experimental
|
|
|
|
|
|