_facetDataFetcher.cleanup(reader);
int maxDoc = reader.maxDoc();
int size = dataMap == null ? 1 : (dataMap.size() + 1);
BigSegmentedArray order = new BigIntArray(maxDoc);
TermValueList<?> list = _termListFactory == null ? new TermStringList(size) : _termListFactory
.createTermList(size);
int[] freqs = new int[size];
int[] minIDs = new int[size];
int[] maxIDs = new int[size];
list.add(null);
freqs[0] = nullFreq;
minIDs[0] = nullMinId;
maxIDs[0] = nullMaxId;
if (dataMap != null) {
int i = 1;
Integer docId;
for (Map.Entry<Object, LinkedList<Integer>> entry : dataMap.entrySet()) {
list.add(list.format(entry.getKey()));
docList = entry.getValue();
freqs[i] = docList.size();
minIDs[i] = docList.get(0);
while ((docId = docList.poll()) != null) {
doc = docId;
order.add(docId, i);
}
maxIDs[i] = doc;
++i;
}
}