Command Line Interface¶
CLI commands¶
app¶
import¶
import-taxonomies¶
sync-scripts¶
cleanup-indexes¶
run-update-daemon¶
export-openapi¶
export-config-schema¶
export-settings-schema¶
CLI Implementation¶
This module provides different commands to help setting up search-a-licious or doing maintenance operations.
- app.cli.main.cleanup_indexes(config_path: ~pathlib.Path | None = <typer.models.OptionInfo object>, index_id: str | None = <typer.models.OptionInfo object>)[source]¶
Clean old indexes that are not active anymore (no aliases)
As you do full import of data or update taxonomies, old indexes are not removed automatically. (in the case you want to roll back or compare).
This command will remove all indexes that are not active anymore.
- app.cli.main.export_config_schema(target_path: ~pathlib.Path = <typer.models.ArgumentInfo object>)[source]¶
Export Configuration json schema to a file.
- app.cli.main.export_openapi(target_path: ~pathlib.Path = <typer.models.ArgumentInfo object>)[source]¶
Export OpenAPI specification to a file.
- app.cli.main.export_schema(class_: type[Config] | type[Settings], target_path: Path)[source]¶
Export schema to a file.
- app.cli.main.export_settings_schema(target_path: ~pathlib.Path = <typer.models.ArgumentInfo object>)[source]¶
Export Configuration json schema to a file.
- app.cli.main.import_data(input_path: ~pathlib.Path = <typer.models.ArgumentInfo object>, skip_updates: bool = <typer.models.OptionInfo object>, partial: bool = <typer.models.OptionInfo object>, num_processes: int = <typer.models.OptionInfo object>, num_items: int | None = <typer.models.OptionInfo object>, config_path: ~pathlib.Path | None = <typer.models.OptionInfo object>, index_id: str | None = <typer.models.OptionInfo object>)[source]¶
Import data into Elasticsearch.
This command is used to initialize or refresh your index with data.
File must contains one JSON document per line, each document must have same format as a document returned by the API.
- app.cli.main.import_taxonomies(config_path: ~pathlib.Path | None = <typer.models.OptionInfo object>, index_id: str | None = <typer.models.OptionInfo object>, skip_indexing: bool = <typer.models.OptionInfo object>, skip_synonyms: bool = <typer.models.OptionInfo object>)[source]¶
Import taxonomies into Elasticsearch.
It download taxonomies json files as specified in the configuration file.
It creates taxonomies indexes (for auto-completion).
It creates synonyms files for ElasticSearch analyzers (enabling full text search to benefits from synonyms).
- app.cli.main.run_update_daemon(config_path: ~pathlib.Path | None = <typer.models.OptionInfo object>)[source]¶
Run the daemon responsible for listening to document updates from Redis Stream and updating the Elasticsearch index.
This command must be run in a separate process to the api server.
It is optional but enables having an always up-to-date index, for applications where data changes.