This is old. Still worth replying, as sometimes somebody might stumble across the same problem.
Well I achieved this rather simply by using facet.pivot. If you define your facet.pivot as “n_cellered_diseaseExact,id” you will get in return the data structure containing pivot list of all diseases, with each disease containing in turn a list of ids of documents matching it. You can control the max length of this id sublist using the facet.limit parameter. It would be useful to set it to some large number, larger, than length of any list You expect. In my case number 200 was sufficient. So the solution is: pivot.facet=n_cellered_diseaseExact,id facet.limit=200 Good luck.