summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrivateGER <privateger@privateger.me>2025-02-19 16:33:01 +0100
committerPrivateGER <privateger@privateger.me>2025-02-19 16:34:48 +0100
commit691a9a6be2a3a0cd58397ee273a72c5b24c96a4e (patch)
tree3e41045e6c0c5da7cefc13c862f9b5a11f3a57f4
parentchange to sqlTsvector (diff)
parentsimplify tsvector implementation, remove cover density (diff)
downloadsharkey-691a9a6be2a3a0cd58397ee273a72c5b24c96a4e.tar.gz
sharkey-691a9a6be2a3a0cd58397ee273a72c5b24c96a4e.tar.bz2
sharkey-691a9a6be2a3a0cd58397ee273a72c5b24c96a4e.zip
Rename tsvector to sqlTsvector
-rw-r--r--.config/example.yml2
-rw-r--r--packages/backend/src/config.ts2
-rw-r--r--packages/backend/src/core/SearchService.ts4
3 files changed, 4 insertions, 4 deletions
diff --git a/.config/example.yml b/.config/example.yml
index fd30d8923b..d199544589 100644
--- a/.config/example.yml
+++ b/.config/example.yml
@@ -222,7 +222,7 @@ fulltextSearch:
# You need to install pgroonga and configure it as a PostgreSQL extension.
# In addition to the above, you need to create a pgroonga index on the text column of the note table.
# see: https://pgroonga.github.io/tutorial/
- # - tsvector
+ # - sqlTsvector
# Use Postgres tsvectors.
# You need to create a generated column and index on the note table to use this, followed by an ANALYZE on the table. Beware, this will take a while to be created and the database will remain locked during this process.
# This also enables advanced search syntax, see documentation of websearch_to_tsquery: https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES
diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts
index 938f44c024..c571c227a1 100644
--- a/packages/backend/src/config.ts
+++ b/packages/backend/src/config.ts
@@ -254,7 +254,7 @@ export type Config = {
};
};
-export type FulltextSearchProvider = 'sqlLike' | 'sqlPgroonga' | 'meilisearch' | 'tsvector';
+export type FulltextSearchProvider = 'sqlLike' | 'sqlPgroonga' | 'meilisearch' | 'sqlTsvector';
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);
diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts
index 2934d08c2d..3aafac1599 100644
--- a/packages/backend/src/core/SearchService.ts
+++ b/packages/backend/src/core/SearchService.ts
@@ -241,7 +241,7 @@ export class SearchService {
switch (this.provider) {
case 'sqlLike':
case 'sqlPgroonga':
- case 'tsvector': {
+ case 'sqlTsvector': {
// ほとんど内容に差がないのでsqlLikeとsqlPgroongaを同じ処理にしている.
// 今後の拡張で差が出る用であれば関数を分ける.
return this.searchNoteByLike(q, me, opts, pagination);
@@ -281,7 +281,7 @@ export class SearchService {
if (this.config.fulltextSearch?.provider === 'sqlPgroonga') {
query.andWhere('note.text &@~ :q', {q});
- } else if (this.config.fulltextSearch?.provider === "tsvector") {
+ } else if (this.config.fulltextSearch?.provider === "sqlTsvector") {
query.andWhere('note.tsvector_embedding @@ websearch_to_tsquery(:q)', { q });
} else {
query.andWhere('note.text ILIKE :q', { q: `%${ sqlLikeEscape(q) }%` });