Skip to content

Commit

Permalink
全文検索アルゴリズムをpgroongaに
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-20 committed Jan 31, 2024
1 parent ab35eac commit 5f0b891
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/database/src/repositories/clip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export const findClipsByUserIdAndReadStatus = async (
readStatus === 'read' && eq(clips.status, 2),
text !== '' &&
or(
sql`to_tsvector(${articles.body}) @@ to_tsquery(${text})`,
sql`to_tsvector(${articles.title}) @@ to_tsquery(${text})`,
sql`${articles.body} &@~ ${text}`,
sql`${articles.title} &@~ ${text}`,
),
url !== '' && eq(articles.url, url),
]),
Expand Down
4 changes: 2 additions & 2 deletions packages/database/src/repositories/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export const findInboxItemsByUserId = async (
condition,
text !== '' &&
or(
sql`to_tsvector(${articles.body}) @@ to_tsquery(${text})`,
sql`to_tsvector(${articles.title}) @@ to_tsquery(${text})`,
sql`${articles.body} &@~ ${text}`,
sql`${articles.title} &@~ ${text}`,
),
url !== '' && eq(articles.url, url),
]),
Expand Down

0 comments on commit 5f0b891

Please sign in to comment.