Unless you are sorting by the function, hll and unique fail to work after the first bucket. I think this only affects unreleased master (7.0-dev) since it looks to have been caused by LUCENE-7407
Explore switching doc values to an iterator API
Commit 3546fc3f5826526ca1ca82086732d7a0ab0c1076 in lucene-solr's branch refs/heads/branch_6x from Yonik Seeley
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3546fc3 ]
SOLR-10596: fix unique/hll docvalue iterator reuse
Commit 3a7aedcef9a6c9f854508629759bcb9b766d2b08 in lucene-solr's branch refs/heads/master from Yonik Seeley
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3a7aedc ]
Here's a patch that grabs fresh DocValues instances (since they can no longer be reused) in the reset method.
I'll audit the rest of the aggregations to make sure there aren't others that need a fix.