full-text-search

Implements product full-text search across PostgreSQL and Elasticsearch providers with reindexing and sync.

74|11|Updated Jul 4, 2024
One-click install
npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill full-text-search-opensourceagi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: full-text-search
Source: https://github.com/OpenSourceAGI/qwksearch-research-agent/tree/main/apps/qwk-in-lobe/.agents/skills/full-text-search
Command: npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill full-text-search-opensourceagi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It guides engineers through LobeHub's product full-text search architecture, ensuring changes to searchable entities, providers, mappings, and sync pipelines stay consistent across every layer instead of breaking permissions, ranking, or data freshness. ## Core Features & Use Cases - Provider Architecture Guidance: Enforces the createFtsSearchRepo entry point, provider invariants for pg_search and Elasticsearch, and permission-preserving hydration boundaries. - Cross-Layer Entity Changes: Provides a checklist for adding or modifying searchable entities across document schemas, mappings, builders, backends, capture triggers, and reindex checkpoints. - Capture, Reindex, and Sync Operations: Documents the Outbox-based change capture, resumable backfill, incremental draining, dead-letter handling, and the supported operator commands. - Use Case: When adding a new searchable entity like chat groups, follow the skill to update the document schema, mapping fixtures, both backends, capture triggers, and reindex checkpoints as one coherent change. ## Quick Start Ask the agent to add a new searchable entity to the product full-text search and update the schema, mapping, backends, and capture infrastructure accordingly.

Frequently Asked Questions about full-text-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new searchable entity to Elasticsearch and PostgreSQL search?

Treat it as one cross-layer change: update the shared entity list and types, document schema and mapping, the document builder, both backend implementations, capture triggers, and reindex checkpoints. Schema fields, mappings, builders, and fixtures must agree exactly.

How do I switch the full-text search provider from pg_search to Elasticsearch?

Set the FTS_SEARCH_PROVIDER environment variable to elasticsearch after running the backfill and confirming the Outbox is empty and stable. Keep the application on PostgreSQL until aliases are ready, then switch explicitly.

Does Elasticsearch search preserve user and workspace permissions?

Yes. Elasticsearch only supplies candidate IDs, and PostgreSQL hydration with parent checks remains the authoritative permission boundary. Raw Elasticsearch hits are never returned directly when authorization is required.

Why does Elasticsearch multi_match query length have a limit?

Query length is bounded by a shared leaf-clause budget divided by the number of query fields per entity. Adding fields reduces the safe query length, and analyzer changes require revisiting the budget and its regression tests.

What happens when search sync retries are exhausted?

Permanent failures and exhausted retries become durable dead letters in the Outbox. A drain that creates or observes dead work must fail rather than publish a successful cutover signal.