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

* [questions][feat] update text search

* [questions][feat] update threshhold for search
pull/519/head
hpkoh 2 years ago committed by GitHub
parent 075f7bfba8
commit d311d8dd96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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