redis-om-spring
redis-om-spring copied to clipboard
Bug: search command not passing sorting parameters
Repository implementation:
Page<Movie> search(String searchCriteria, Pageable pageable);
When you pass sorting criteria via the PageRequest:
PageRequest pageRequest = PageRequest.of(page, size)
.withSort(Sort.by(Direction.DESC, sortByField));
repository.search("*", pageRequest);
this translates into the RediSearch query: "FT.SEARCH" "io.redis.model.MovieIdx" "*" "LIMIT" "0" "20"
where the query should be: "FT.SEARCH" "io.redis.model.MovieIdx" "*" "SORTBY" "<field>" "DESC" "LIMIT" "0" "20"
The sorting criteria is completely ignored, whereas on other repository methods it is accounted for.
@ally-jarrett this has been fixed and will be in the next release.
excellent, thanks @bsbodden