Related: TUIT, Troubleshooting → CLI, Observability → OpenTelemetry Operator-focused tasks for schema lifecycle and indexing. All tasks are thin facades over documented APIs with small, structured instrumentation.Documentation Index
Fetch the complete documentation index at: https://nikita-shkoda.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Commands
- collection: either a fully-qualified class name (e.g.,
SearchEngine::Book) or a logical identifier (e.g.,book/books). - partition: opaque partition key. Numeric strings are parsed as integers; otherwise treated as strings.
Usage
- Show tasks:
rails -T | grep search_engine - Diff schema:
rails ‘search_engine:schema:diff[SearchEngine::Book]’ - Apply schema:
rails ‘search_engine:schema:apply[books]’ - Rollback schema:
rails ‘search_engine:schema:rollback[books]’ - Prune orphans:
rails ‘search_engine:schema:prune_orphans[books]’(or omit[collection]for all) - Rebuild all partitions:
rails ‘search_engine:index:rebuild[SearchEngine::Book]’ - Rebuild a partition:
rails ‘search_engine:index:rebuild_partition[SearchEngine::Book,42]’ - Delete stale docs:
rails ‘search_engine:index:delete_stale[books,42]’ - Doctor diagnostics:
rails search_engine:doctor
Note:
rails -T always prints task names without quotes (e.g., rails search_engine:index:rebuild[collection]). When invoking tasks that use brackets, wrap the whole invocation in quotes to avoid shell globbing, e.g., rails ‘search_engine:index:rebuild[products]’.Environment flags
DRY_RUN=1: Forindex:rebuild, preview first batch only (no HTTP); forindex:delete_stale, show filter hash and estimation (if enabled) without deleting.DISPATCH=inline|active_job: Override dispatch mode for rebuild tasks (defaults from config).VERBOSE=1: Print additional details (e.g., schema diff JSON and dry-run sample line). Fordoctor, shows untruncated hints.FORMAT=json: Machine-readable output. Fordoctor, prints{ ok, summary, checks }.STRICT=1: Forindex:delete_stale, treat missing filter as violation.TIMEOUT=seconds: Fordoctor, override per-request timeout for health/API calls.HOST/PORT/PROTOCOL: Fordoctor, temporary overrides to test connectivity.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | Rollback not possible |
| 3 | Strict safety violation |
| 10 | Schema drift detected (diff) |
Behavior summary
schema:diff: Compares compiled schema vs the active physical (via alias). Prints compact summary;VERBOSE=1dumps details. Exits10when drift exists.schema:apply: Creates a new physical, reindexes (all partitions), swaps alias, drops old physicals per retention. Prints a compact summary.schema:rollback: Swaps alias to previous retained physical. Exits2when none available.schema:prune_orphans: Scans physical collections matching the timestamped naming pattern and drops any that are not alias targets. Optional[collection]scopes to one logical name; omit to scan all. Prints dropped/kept counts.index:rebuild: IfpartitionsDSL exists, enumerates and dispatches per partition; otherwise a single inline run.DRY_RUN=1maps only the first batch and prints a preview. Does not perform alias swaps or retention cleanup; useschema:applyfor blue/green and retention.index:rebuild_partition: Rebuilds a single partition; respectsDISPATCHor config defaults.index:delete_stale: Compilesstalerules (declared insideindex) into an OR‑merged filter and deletes by filter. If no rules produce a filter: warns and exits0, or3withSTRICT=1.DRY_RUN=1prints preview without deleting.doctor: Validates config/ENV presence, connectivity (health), API key validity, alias resolution for registered collections, compiles a dry-run single search and a multi-search without I/O, reports logging mode, and OpenTelemetry status. Prints human-readable by default or JSON withFORMAT=json. Exits1on any failure.
Doctor flow
Backlinks: Observability → OpenTelemetry, Installation, Configuration See also: Configuration and Observability for logging and OTel.Live progress
On TTY terminals, schema lifecycle and indexation tasks display animated progress using braille spinners and per-partition progress bars. Each lifecycle step (Presence, Schema,
Indexing, Retention) shows real-time status via
StepLine. Parallel partition imports render a multi-line
LiveRenderer with doc-based progress percentages and
elapsed time. On non-TTY (CI, pipes), output falls back to static
one-line-per-event logging.
For StepLine, Spinner, and LiveRenderer, see
Observability → Live progress (TTY).
Safety notes
- Stale deletes never run with an empty filter. A short hash of the filter is printed for traceability.
- Partition keys are opaque. Numeric strings are converted to integers; other values remain strings.
- Failed indexation during
schema:applyprevents the alias swap; the new physical is left for inspection. See Schema → Failed indexation safety.
See also
- Schema — compiler, diff, apply! and rollback
- Indexer — import flow, dry-run, partitioning, dispatcher
- Observability