Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easiest way to sort #14

Open
abresler opened this issue Apr 27, 2015 · 5 comments
Open

Easiest way to sort #14

abresler opened this issue Apr 27, 2015 · 5 comments

Comments

@abresler
Copy link

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?

@romansanchez
Copy link
Owner

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

@abresler
Copy link
Author

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

@DASAR-zz
Copy link

DASAR-zz commented Jun 3, 2015

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

@romansanchez
Copy link
Owner

@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.

@JoeDylanK
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants