EN

@core / search

1.0.0 ▾
verifiedMIT
GitHub

Site search on Postgres full-text: per-language stemming, prefix matching, safe snippets and typo fallback

Code8 filesContext~511 tokensscan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/search/adapters/next.tsread-only · ae66128
// Adaptador Next.js: `app/api/search/route.ts` → `export { searchRoute as GET } from '@/lib/search/adapters/next';`
// En Server Components llama a `search()` directamente.
import { search } from '../index.ts';

export async function searchRoute(req: Request): Promise<Response> {
  const p = new URL(req.url).searchParams;
  const res = await search((p.get('q') ?? '').slice(0, 200), {
    locale: p.get('locale') ?? undefined,
    types: p.getAll('type'),
    limit: Number(p.get('limit') ?? 10) || 10,
  });
  return Response.json(res, { headers: { 'cache-control': 'public, max-age=60' } });
}

Report @core/search

Sign in with GitHub to report a package.