int saverecords=dff.offset + dff.limit;
GroupbyItem[] counts = dff.getPairSorted(saverecords);
if(dff.recordcount!=null)
{
GroupbyItem recordcount=dff.recordcount;
fieldCounts.add("count", recordcount.toNamedList());
}
int end = dff.limit < 0 ? counts.length : Math.min(dff.offset + dff.limit, counts.length);
ArrayList<Object> list=new ArrayList<Object>();
for (int i=dff.offset; i<end; i++) {
GroupbyItem item=counts[i];
list.add(item.toNamedList());
}
fieldCounts.add("list", list);
rb.rsp.add("mdrill_data", fieldCounts);
}