Rename tsvector to sqlTsvector

This commit is contained in:
PrivateGER 2025-02-19 16:33:01 +01:00
commit 691a9a6be2
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View file

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

View file

@ -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) }%` });