From befbead59f10e1039e6500e5cb0fae150adf2b90 Mon Sep 17 00:00:00 2001 From: Balu Babu Date: Tue, 12 Mar 2024 11:27:18 +0530 Subject: [PATCH] chore: changed to_tsquery function to another function to handle whitespaces --- .../src/team-collection/team-collection.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts b/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts index 6def6a2fe..7b1775b92 100644 --- a/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts +++ b/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts @@ -1151,7 +1151,7 @@ export class TeamCollectionService { select id,title,'collection' AS type from "TeamCollection" where "TeamCollection"."teamID"=${teamID} - and titlesearch @@ to_tsquery(${searchQuery}) + and titlesearch @@ plainto_tsquery(${searchQuery}) order by ts_rank(titlesearch,to_tsquery(${searchQuery})) limit ${take} OFFSET ${skip === 0 ? 0 : (skip - 1) * take}; @@ -1183,7 +1183,7 @@ export class TeamCollectionService { select id,title,request->>'method' as method,'request' AS type from "TeamRequest" where "TeamRequest"."teamID"=${teamID} - and titlesearch @@ to_tsquery(${searchQuery}) + and titlesearch @@ plainto_tsquery(${searchQuery}) order by ts_rank(titlesearch,to_tsquery(${searchQuery})) limit ${take} OFFSET ${skip === 0 ? 0 : (skip - 1) * take};