-
Notifications
You must be signed in to change notification settings - Fork 77
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
How to sort? #106
Comments
Will be looking into this myself in the near future. But could you pass a form_class in your view similar to how it would be achieved with a standard haystack view? |
http://www.django-rest-framework.org/api-guide/filtering/#orderingfilter |
@rhblind I'm testing the ordering and it is not working with char fields. Do I have to do anything different when indexing char fields? |
@rodrigowirth What backend do you use? I've done some testing on this with Elasticsearch backend and for me it "somewhat" works. The reason is that Elasticsearch (or any other backend for that matter) does ordering slightly differently. I've not fully managed to understand how this works, but in practice any Unfortunately I don't have any better answer other than that I'd also like to have this feature working, but haven't had time to look too deeply into it yet. 😕 |
sorting is not working for the fields of type long in solr. I am using django-haystack library. |
I can search by field like
/search?is_approved=true&is_active=true
However, I need a way to sort the result by a field e.g.
/search?is_approved=true&is_active=true&order=[-date]
How to achieve this?
The text was updated successfully, but these errors were encountered: