As described in SOLR-7214, the unique function seems wildly off, but only if you have enough values.
Bulk close for 5.2.0.
Commit 1677092 from Yonik Seeley in branch 'dev/branches/branch_5x'
[ https://svn.apache.org/r1677092 ]
SOLR-7494: fix unique() function for high cardinality fields
Commit 1677091 from Yonik Seeley in branch 'dev/trunk'
[ https://svn.apache.org/r1677091 ]
Here's the fix.