
Product Full-Text Search
Implements product search with pg_search or Elasticsearch, sync and reindexing.
Install
npx skills add lobehub/lobehub --skill full-text-search -g -a claude-code -y- Repository
- lobehub/lobehub83.7k
- Category
- Engineering
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Use for product search: FtsSearchRepo, pg_search/pg_like/Elasticsearch, mapping migrations, projections, Outbox sync, reindexing and performance. Excludes agent web search.
Product Full-Text Search
This skill covers search over LobeHub-owned product data such as agents, topics, messages, files,
knowledge bases, documents, chat groups, and memories. It does not cover the agent's external web
search providers under apps/server/src/services/search/ or builtin web-browsing tools.
Architecture
Product reads follow one stable path:
router/service -> createFtsSearchRepo -> FtsSearchRepo -> selected backend -> existing result schema
apps/server/src/services/ftsSearch/owns request-scoped provider selection, Elasticsearch configuration, its HTTP client, and backend telemetry. Routers and domain services must callcreateFtsSearchRepo; they must not construct providers themselves.packages/database/src/repositories/ftsSearch/owns the provider-neutral contract and the concrete PostgreSQL and Elasticsearch implementations. Keep public result shapes stable inFtsSearchRepo.packages/types/src/ftsSearch.tsowns the shared searchable-entity list and search domain types.packages/database/src/repositories/ftsSearchDocument/owns Elasticsearch document schemas, mappings, queryable fields, and source-to-document projection.packages/database/src/schemas/ftsSearchSyncOutbox.tsandpackages/database/src/repositories/ftsSearchSyncOutbox/own durable change capture, claims, retries, dead letters, leases, revision fences, and capture-definition validation.scripts/elasticsearchReindex/owns the resumable full-backfill command and its operational runtime. Shared database source queries and document construction remain inpackages/database/src/repositories/ftsSearchDocument/.apps/server/src/services/ftsSearchSync/andscripts/elasticsearchSync/own continuous incremental draining.packages/env/src/ftsSearch.tsowns generic Elasticsearch environment variables.
