ZH
测试版翻译

@core / search

1.0.0 ▾
已验证MIT
GitHub

基于 Postgres 全文检索的站内搜索:按语言词干、前缀匹配、安全摘要和错字容错

代码8 个文件上下文约 511 个 token扫描通过

应用 .genpmignore 后将被注入的确切目录树。固定于

src/lib/search/adapters/hono.ts只读 · ae66128
// Adaptador Hono: `app.route('/api/search', searchRoutes())` → GET /api/search?q=taza&locale=es&type=product
import { Hono } from 'hono';
import { search } from '../index.ts';

export function searchRoutes() {
  return new Hono().get('/', async (c) => {
    const q = (c.req.query('q') ?? '').slice(0, 200);
    const types = c.req.queries('type');
    const res = await search(q, { locale: c.req.query('locale'), types, limit: Number(c.req.query('limit') ?? 10) || 10 });
    c.header('cache-control', 'public, max-age=60');
    return c.json(res);
  });
}

举报 @core/search

使用 GitHub 登录后才能举报包。