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

Sort findByStatus #17

Open
Monra opened this issue Feb 20, 2022 · 3 comments
Open

Sort findByStatus #17

Monra opened this issue Feb 20, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Monra
Copy link

Monra commented Feb 20, 2022

The resource findByStatus sorts only inside the page and not over complete collection.

Actual:
http://host/encoreJobs/search/findByStatus?status=SUCCESSFUL&sort=createdDate,desc&page=0&size=2
Response: {... [{... "createdDate": "2022-01-04" ...},{... "createdDate": "2022-01-02" ...}] ...}
http://host/encoreJobs/search/findByStatus?status=SUCCESSFUL&sort=createdDate,desc&page=1&size=2
Response: {... [{... "createdDate": "2022-01-03" ...},{... "createdDate": "2022-01-01" ...}] ...}

Expected:
http://host/encoreJobs/search/findByStatus?status=SUCCESSFUL&sort=createdDate,desc&page=0&size=2
Response: {... [{... "createdDate": "2022-01-04" ...},{... "createdDate": "2022-01-03" ...}] ...}
http://host/encoreJobs/search/findByStatus?status=SUCCESSFUL&sort=createdDate,desc&page=1&size=2
Response: {... [{... "createdDate": "2022-01-02" ...},{... "createdDate": "2022-01-01" ...}] ...}

@Monra Monra added the bug Something isn't working label Feb 20, 2022
@grusell
Copy link
Contributor

grusell commented Feb 21, 2022

Many thanks for reporting, we will look into this.

@deedos
Copy link

deedos commented Mar 7, 2022

The exactly same thing happens when listing the /encoreJobs . The sorting criteria works within the page but not over the complete collection.

/encoreJobs?sort=createdDate&page=0&size=15

returns me jobs with createdDate ordered but at page 1:

/encoreJobs?sort=createdDate&page=1&size=15

I have more recent jobs.

With this bug it's impossible to order all jobs chronologically.

thanks a lot

@grusell
Copy link
Contributor

grusell commented Aug 24, 2022

The problem with sorting is due to a limitation in spring-data-redis. Should be possible to implement a workaround, we are looking at this but it is unclear when we might have time to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants