Skip to content

Commit

Permalink
add sort param
Browse files Browse the repository at this point in the history
  • Loading branch information
micnori committed Mar 27, 2024
1 parent 7ee9cd6 commit c574841
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ private QueryResponse prepareQuery(

MultiMapSolrParams.addParam("start", String.valueOf(pageRequest.getOffset()), queryParamMap);
MultiMapSolrParams.addParam("rows", String.valueOf(pageRequest.getPageSize()), queryParamMap);
if(pageRequest.getSort().isSorted()) {
pageRequest.getSort().forEach(order -> {
MultiMapSolrParams.addParam("sort",
order.getProperty() + " " + order.getDirection().toString(), queryParamMap);
});
}

return solrClient.query(solrCollection, new MultiMapSolrParams(queryParamMap));
}
Expand Down

0 comments on commit c574841

Please sign in to comment.