Skip to content

Commit

Permalink
Retrieve tags sorted order by questionCount
Browse files Browse the repository at this point in the history
  • Loading branch information
EnesBaserr committed Dec 10, 2024
1 parent 94135ed commit 1fb606f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
@Repository
public interface TagRepository extends JpaRepository<Tag,Long> {
List<Tag> findAllByIdIn(List<Long> ids);
@Query("SELECT t FROM Tag t " +
"JOIN Question q ON t MEMBER OF q.tags " +
"GROUP BY t.id " +
"ORDER BY COUNT(q.id) DESC")

Page<Tag> findTagsByTagNameContainingIgnoreCase(String tagName, Pageable pageable);
@Query("SELECT t FROM Tag t JOIN t.followers u WHERE u.id = :userId")
Expand Down

0 comments on commit 1fb606f

Please sign in to comment.