chore: changed to_tsquery function to another function to handle whitespaces

This commit is contained in:
Balu Babu
2024-03-12 11:27:18 +05:30
parent dce396c164
commit befbead59f

View File

@@ -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};