romansanchez/Calaca

Easiest way to sort

abresler opened this issue · 5 comments

trying to figure out how to modify the base code to allow for sorting of a selected numeric field in descending order. Any advice on how to best achieve that?

Uses angular so you could easily build a table then use orderBy. See https://docs.angularjs.org/api/ng/filter/orderBy

Any chance you could suggest a toy example that ties to elastic? Having issues trying to figure out where to put the ordering? Doesn't seem to be working in the section i'd think it belongs/

ng-repeat='result in results track by $id(result) | orderBy:"-amount"'>

Where amount is the ordering variable

@abresler Maybe you have to do ordering inside elasticsearch query? I think it most reasonable.

@dasar that's possible too, but I think sorting from UI should also be possible in the case it's being used by non-technical users.

Bit late to the party - but using orderBy works, except the pagination breaks it. Say you're showing 10 results per page and have 100 results in total that match, it'll show like every 10th value. Any suggestions?