Skip to content

Commit

Permalink
Merge pull request #1104 from amvanbaren/bugfix/issue-1062
Browse files Browse the repository at this point in the history
Always include score when sorting
  • Loading branch information
amvanbaren authored Feb 13, 2025
2 parents e326ef4 + e681745 commit 1f69309
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,8 @@ private void sortResults(NativeQueryBuilder queryBuilder, String sortOrder, Stri
if(type == null) {
throw new ErrorResultException("sortBy parameter must be 'relevance', 'timestamp', 'averageRating' or 'downloadCount'.");
}
if ("relevance".equals(sortBy)) {
queryBuilder.withSort(builder -> builder.score(scoreSort -> scoreSort.order(order)));
}

queryBuilder.withSort(builder -> builder.score(scoreSort -> scoreSort.order(order)));
queryBuilder.withSort(builder -> builder.field(fieldSort -> fieldSort.field(sortBy).unmappedType(type).order(order)));
}

Expand Down

0 comments on commit 1f69309

Please sign in to comment.