[questions][feat] update threshhold for search (#515)

* [questions][feat] update text search

* [questions][feat] update threshhold for search
This commit is contained in:
hpkoh
2022-11-06 02:40:51 +08:00
committed by GitHub
parent 075f7bfba8
commit d311d8dd96

View File

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