Strange secondary sorting for TermsFacet (with identical counts)


(Jan Fiedler) #1

I noticed a strange sorting of TermsFacet entries returned by ES. If
you have 2 documents with a string field providing values 'foo' and
'bar' and you run a TermsFacet on this field (ordered by count), you
get two entries with a count of 1 (as expected). I would have expected
value 'bar' to show up before 'foo' (i.e. ascending alphabetic
sorting) for entries with the same count. It seems to be sorted
descending on the term value though.

Find a curl based reproduction of the problem here: https://gist.github.com/986550

If the behavior is as designed, is there an API to provide my own
comparator for sorting entries returned by ES ? This would also be
useful for providing correct locale specific sorting of facet term
values.


(system) #2