[questions][feat] update threshhold for search

pull/515/head
hpkoh 3 years ago
parent e3d57771ea
commit 0762a8eb45

@ -235,7 +235,7 @@ export const questionsQuestionRouter = createRouter()
.$queryRaw` .$queryRaw`
SELECT id FROM "QuestionsQuestion" SELECT id FROM "QuestionsQuestion"
WHERE 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; ORDER BY ts_rank_cd(to_tsvector("content"), to_tsquery('english', ${query}), 4) DESC;
`; `;
@ -314,7 +314,7 @@ export const questionsQuestionRouter = createRouter()
.$queryRaw` .$queryRaw`
SELECT id FROM "QuestionsQuestion" SELECT id FROM "QuestionsQuestion"
WHERE 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; ORDER BY ts_rank_cd(to_tsvector("content"), to_tsquery('english', ${query}), 4) DESC;
`; `;
} }

Loading…
Cancel
Save