-
Notifications
You must be signed in to change notification settings - Fork 3
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
sorting does not work when combined with other filters #339
Comments
@sennierer any insights on this? |
Looking into this now: it seems at first glance that Using MPR data, the first 55 results are sorted, then the rest are in some random order:
I guess this is just the order they are stored in the database — with the result that any filters end up showing results that go beyond the top few which happen to be in the right order. @stefanprobst Can you confirm this in some way, using your data? |
yep, i guess that is what's happening. ICA backerd also seems to go unsorted at index 53, see:
|
…backends #339 Sorting not implemented; added the rest_framework OrderingFilters, which allows filtering on fields using `ordering` param
I think this fix should resolve the problem. It seems the drf The drf param for sorting is |
Richard's PR is merged into main and so @stefanprobst please check and close this issue if verified. |
the above query: curl "https://ica.acdh-dev.oeaw.ac.at/apis/api/entities/person/?sort=name&limit=200" | jq '.results[].name ' | cat -n is now sorted, thx. how to sort in descending order? |
also, looks like it does not show up in the openapi docs here: https://ica.acdh-dev.oeaw.ac.at/apis/swagger/schema/swagger-ui/#/apis/apis_api_entities_person_list |
put a - before the parameter (see https://www.django-rest-framework.org/api-guide/filtering/) |
actually no - there is still something wrong. please try: curl "https://ica.acdh-dev.oeaw.ac.at/apis/api/entities/person/?ordering=-name&limit=500" | jq '.results[].name ' | cat -n |
are apis instances updated with this fix? |
can you post an example request where this is working? |
Not sure. I think @steffres merged this change, but maybe only into |
I merged it, but am not aware of the current state of CI/CD and everything autodeployment-wise and github migration. The PR is both in |
if auto-deployment is not working - are you fixing it? should i open a new issue? where would i check if something failed? |
@sennierer what is the status on CI/CD on github please? In this issue here, a PR provides fix but apparentely it's not yet deployed. |
(i) the
sort
query parameter is not documented in openapi, but i correctly guessed that the following will sort persons by their name:(ii) however, when adding an additional query parameter, search results are no longer sorted:
(iii) confusingly, the second request seems to include names which are not returned in the first request, e.g. "Beer-Hofmann" - not sure what that means?
The text was updated successfully, but these errors were encountered: