The counter at index 0 is special as it is used to count documents without any value in the given facet. This count can exceed the maxTermCount and thus overflowing the counts for the first few terms.
This can either be solved by setting maxTermCount = maxDoc (very memory wasteful) or by using a dedicated int for the 0-counter (potentially slowing updates).
The counter at index 0 is special as it is used to count documents without any value in the given facet. This count can exceed the maxTermCount and thus overflowing the counts for the first few terms.
This can either be solved by setting maxTermCount = maxDoc (very memory wasteful) or by using a dedicated int for the 0-counter (potentially slowing updates).