mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-04-03 19:07:57 +08:00
[questions][feat] update threshhold for search (#515)
* [questions][feat] update text search * [questions][feat] update threshhold for search
This commit is contained in:
@@ -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;
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user