pathSpec.setOrderBy(FacetSortSpec.OrderByCustom);
pathSpec.setCustomComparatorFactory(new ComparatorFactory(){
public IntComparator newComparator(
FieldValueAccessor fieldValueAccessor, final int[] counts) {
return new IntComparator(){
public int compare(Integer f1, Integer f2) {
int val = counts[f2] - counts[f1];
if (val==0)
{