fcsize = facetCounts.size();
}
if(groupValueCacheLast==null)
{
for(int i=0;i<fcsize;i++){
GroupbyRow row = new GroupbyRow((ArrayList<Object>)facetCounts.get(i));
row.setCross(crossFs, distFS);
String groupValues = row.getKey().getKey();
groupValueCache.put(groupValues, row);
JSONObject jo = new JSONObject();
setGroup(jo, groupFields, joins, groupValues);
setStat(jo, showFields, row);
jsonArray.add(i, jo);
}
}else{
for(int i=0;i<fcsize;i++){
GroupbyRow row = new GroupbyRow((ArrayList<Object>)facetCounts.get(i));
row.setCross(crossFs, distFS);
String groupValues = row.getKey().getKey();
groupValueCache.put(groupValues, row);
}
int index=0;
for(Entry<String,GroupbyRow> e:groupValueCacheLast.entrySet())
{
JSONObject jo = new JSONObject();
String groupValues = e.getKey();
GroupbyRow row = groupValueCache.get(groupValues);
if(row==null)
{
row=e.getValue();
}
row.setCross(crossFs, distFS);
setGroup(jo, groupFields, joins, groupValues);
setStat(jo, showFields, row);
jsonArray.add(index, jo);
index++;