Skip to content

Commit

Permalink
refactor TopicRepository.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladik-gif committed Nov 4, 2024
1 parent d54a6dd commit 2adbd00
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ public interface TopicRepository extends JpaRepository<Topic, UUID> {
@Query("SELECT t FROM Topic t left join fetch t.tags tag where t.scope != 'DELETED' and tag.name=:tagName")
List<Topic> findAllByTagName(@Param("tagName") String tagName);

@Query(
value =
@Query(value =
"""
SELECT *
FROM chat.topics t
WHERE t.scope != 'DELETED' and to_tsvector('english', t.topic_name) @@ to_tsquery('english', :query)
""",
nativeQuery = true)
""", nativeQuery = true)
List<Topic> findAllByName(@Param("query") String query);

@Query(value = "SELECT t FROM Topic t Where t.name = :name and t.scope != 'DELETED'")
Expand Down

0 comments on commit 2adbd00

Please sign in to comment.