KO
베타 번역

@core / search

1.0.0 ▾
인증됨MIT
GitHub

Postgres 전문 검색 기반 사이트 검색: 언어별 어간, 접두어 일치, 안전한 스니펫, 오타 대응

코드파일 8개컨텍스트약 511토큰검사 통과

.genpmignore 적용 후 주입될 정확한 트리입니다. 고정 대상:

src/lib/search/schema.ts읽기 전용 · ae66128
// Tablas de @core/search. Las recoge drizzle-kit vía src/lib/db/drizzle.config.ts.
import { customType, index, pgTable, primaryKey, text, timestamp } from 'drizzle-orm/pg-core';

const tsvector = customType<{ data: string }>({ dataType: () => 'tsvector' });

/** Índice de búsqueda: una fila por documento (`type` + `id`) con su vector ponderado (título A, cuerpo B). */
export const searchDocuments = pgTable(
  'search_documents',
  {
    type: text('type').notNull(),
    id: text('id').notNull(),
    locale: text('locale').notNull(),
    url: text('url').notNull(),
    title: text('title').notNull(),
    body: text('body').notNull(),
    /** Configuración de texto de Postgres usada (`spanish`, `english`, `simple`…). */
    config: text('config').notNull(),
    tsv: tsvector('tsv').notNull(),
    indexedAt: timestamp('indexed_at', { withTimezone: true, mode: 'date' }).notNull().defaultNow(),
  },
  (t) => [
    primaryKey({ columns: [t.type, t.id] }),
    index('search_documents_tsv_idx').using('gin', t.tsv),
    index('search_documents_locale_idx').on(t.locale, t.type),
  ],
);

export type SearchRow = typeof searchDocuments.$inferSelect;

@core/search 신고

패키지를 신고하려면 GitHub로 로그인하세요.