Skip to content

Command Line Interface

The Searchcraft CLI is a command line interface for running and managing the Searchcraft server. It is only available for the self-hosted version of Searchcraft.

Running the CLI

./searchcraft <arguments>

Arguments

--authorization-code <AUTHORIZATION_CODE> The system level auth key. If specified this will enable auth mode and require a token bearer on every endpoint. This key is used to create additional index level auth keys.

--backup-directory <BACKUP_DIRECTORY> The filesystem directory where backups will be stored. Defaults to ”./backups”

--backup-interval <BACKUP_INTERVAL> The interval time in hours to take an automatic backup. This is resource intensive on large datasets, should typically be set to at least 24 hours. The backup will be saved in the directory provided by --backup-directory.

--backup-retention <BACKUP_RETENTION> Max amount in days to retain backups files [default: 14]

--clickhouse-db-name <CLICKHOUSE_DB_NAME> The name of the ClickHouse database for measurement events. Ignored if --clickhouse-db-url is not provided. [default: searchcraft_measure]

--clickhouse-db-url <CLICKHOUSE_DB_URL> The database url of ClickHouse. ClickHouse is used for storing measurement events. If not provided, no measurement events will be stored.

--create-backup Generates a backup of containing the contents of this Searhcraft instance.

--disable-log-color Optionally disable color output in logs (you want this off for CloudWatch).

--disable-log-timestamps Optionally remove timestamps from log output.

--host <HOST> The host to bind to (normally: ‘127.0.0.1’ or ‘0.0.0.0’.) [default: 127.0.0.1]

--help Shows the argument list.

--log-level <LOG_LEVEL> The log level filter, any logs that are above this level won’t be displayed. For more detailed control you can use the RUST_LOG env var.

--max_result_limit <LIMIT> Max limit for the number of results returned by a single search query. This is different than the default query limit value when no limit parameter is provided. This is the absolute highest limit for the number of results returned on this instance. Maximum value is 65_535 but you should typically use a lower value. If a query request sends a limit parameter that is higher than this value, the limit will be reduced to this value. [default: 200]

--port <PORT> The port to bind the server to [default: 8000]

--restore-backup <RESTORE_BACKUP> Load a backup and use it’s data. This expects the ./index directory to not exist.