AircraftOps
Search
Posts

Typesense Initialization CLI

Tools → Command Line Interface

CLI tooling for initializing, validating, and rebuilding Typesense search collections from schema definitions within the AircraftOps search infrastructure.


System Responsibilities

  • Load search collection schemas from repository-managed schema definitions
  • Validate collection existence before creation
  • Safely create missing search collections
  • Optionally rebuild collections using destructive replace workflows
  • Initialize all search collections in a single batch operation

Execution Pipeline

Typesense Initialization Command
        ↓
Schema Definition Load
        ↓
Collection Existence Check
        ↓
Conditional Collection Creation
        ↓
(Optional) Collection Rebuild
        ↓
Search Infrastructure Ready

Collection initialization workflows operate in safe mode by default, preventing accidental deletion of existing search indexes unless the explicit replace flag is provided.


Command Reference

create

Initialize one or more Typesense collections from schema definitions. Existing collections are preserved unless the replace option is specified.

pipenv run python cli -m init-typesense create
    <collection|all>
    [--replace]
  • Loads collection schema definitions from repository configuration
  • Checks whether the specified collection already exists
  • Creates missing collections safely
  • Optionally deletes and recreates collections when --replace is used

Schema Source

Collection definitions are loaded from the repository-managed schema file:

typesense_schemas.json

Each schema entry defines the searchable fields, indexing configuration, and collection-level settings used by the AircraftOps search platform.


Operational Notes

  • Safe mode prevents accidental index deletion by default
  • Rebuild operations are destructive and should be used only during controlled migrations
  • Bulk initialization supports multi-collection search deployments
  • Collection initialization is typically executed during infrastructure bootstrap or schema migrations