From d311d8dd963ffbc03643d94ed974df0e3d461365 Mon Sep 17 00:00:00 2001 From: hpkoh <53825802+hpkoh@users.noreply.github.com> Date: Sun, 6 Nov 2022 02:40:51 +0800 Subject: [PATCH] [questions][feat] update threshhold for search (#515) * [questions][feat] update text search * [questions][feat] update threshhold for search --- .../src/server/router/questions/questions-question-router.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/portal/src/server/router/questions/questions-question-router.ts b/apps/portal/src/server/router/questions/questions-question-router.ts index 51e33802..e00c4ae8 100644 --- a/apps/portal/src/server/router/questions/questions-question-router.ts +++ b/apps/portal/src/server/router/questions/questions-question-router.ts @@ -235,7 +235,7 @@ export const questionsQuestionRouter = createRouter() .$queryRaw` SELECT id FROM "QuestionsQuestion" WHERE - ts_rank_cd(to_tsvector("content"), to_tsquery(${query}), 32) > 0.7 + ts_rank_cd(to_tsvector("content"), to_tsquery(${query}), 32) > 0.1 ORDER BY ts_rank_cd(to_tsvector("content"), to_tsquery('english', ${query}), 4) DESC; `; @@ -314,7 +314,7 @@ export const questionsQuestionRouter = createRouter() .$queryRaw` SELECT id FROM "QuestionsQuestion" WHERE - ts_rank_cd(to_tsvector("content"), to_tsquery(${query}), 32) > 0.7 + ts_rank_cd(to_tsvector("content"), to_tsquery(${query}), 32) > 0.1 ORDER BY ts_rank_cd(to_tsvector("content"), to_tsquery('english', ${query}), 4) DESC; `; }