From 23db798f454f3a1aafec9fe216ae17b18f1d0fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Mon, 3 Oct 2022 16:07:38 +0200 Subject: [PATCH 1/8] docs: update CLI documentation Closes #2810 --- meilisearch-http/src/option.rs | 102 +++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 29 deletions(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index ae12f0cc6..8a0ea0f44 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -66,7 +66,7 @@ const DEFAULT_LOG_LEVEL: &str = "INFO"; #[clap(version)] #[serde(rename_all = "snake_case", deny_unknown_fields)] pub struct Opt { - /// The destination where the database must be created. + /// Designates the location where database files will be created and retrieved. #[clap(long, env = MEILI_DB_PATH, default_value_os_t = default_db_path())] #[serde(default = "default_db_path")] pub db_path: PathBuf, @@ -81,51 +81,76 @@ pub struct Opt { #[clap(long, env = MEILI_MASTER_KEY)] pub master_key: Option, - /// This environment variable must be set to `production` if you are running in production. - /// More logs wiil be displayed if the server is running in development mode. Setting the master - /// key is optional; hence no security on the updates routes. This - /// is useful to debug when integrating the engine with another service + /// Configures the instance's environment. Value must be either production or development. + /// `production` + /// * Setting a master key is mandatory + /// * The search preview interface is disabled + /// + /// `development`: + /// Setting a master key is optional + /// Search preview is enabled + /// + /// # TIP + /// + /// When the server environment is set to development, providing a master key is not mandatory. + /// This is useful when debugging and prototyping, but dangerous otherwise since API routes + /// are unprotected. #[clap(long, env = MEILI_ENV, default_value_t = default_env(), possible_values = &POSSIBLE_ENV)] #[serde(default = "default_env")] pub env: String, - /// Do not send analytics to Meili. + /// Deactivates Meilisearch's built-in telemetry when provided. + /// + /// Meilisearch automatically collects data from all instances that do not opt out using this flag. + /// All gathered data is used solely for the purpose of improving Meilisearch, and can be deleted + /// at any time. #[cfg(all(not(debug_assertions), feature = "analytics"))] #[serde(skip_serializing, default)] // we can't send true #[clap(long, env = MEILI_NO_ANALYTICS)] pub no_analytics: bool, - /// The maximum size, in bytes, of the main LMDB database directory + /// Sets the maximum size of the index. Value must be given in bytes or explicitly stating a base unit. + /// + /// For example, the default value can be written as `107374182400`, `'107.7Gb'`, or `'107374 Mb'`. + /// + /// The index stores processed data and is different from the task database, which handles pending tasks. #[clap(long, env = MEILI_MAX_INDEX_SIZE, default_value_t = default_max_index_size())] #[serde(default = "default_max_index_size")] pub max_index_size: Byte, - /// The maximum size, in bytes, of the update LMDB database directory + /// Sets the maximum size of the task database. Value must be given in bytes or explicitly stating a + /// base unit. For example, the default value can be written as `107374182400`, `'107.7Gb'`, or + /// `'107374 Mb'`. + /// + /// The task database handles pending tasks. This is different from the index database, which only + /// stores processed data. #[clap(long, env = MEILI_MAX_TASK_DB_SIZE, default_value_t = default_max_task_db_size())] #[serde(default = "default_max_task_db_size")] pub max_task_db_size: Byte, - /// The maximum size, in bytes, of accepted JSON payloads + /// Sets the maximum size of accepted payloads. Value must be given in bytes or explicitly stating a + /// base unit. For example, the default value can be written as `107374182400`, `'107.7Gb'`, or + /// `'107374 Mb'`. #[clap(long, env = MEILI_HTTP_PAYLOAD_SIZE_LIMIT, default_value_t = default_http_payload_size_limit())] #[serde(default = "default_http_payload_size_limit")] pub http_payload_size_limit: Byte, - /// Read server certificates from CERTFILE. - /// This should contain PEM-format certificates - /// in the right order (the first certificate should - /// certify KEYFILE, the last should be a root CA). + /// Sets the server's SSL certificates. + /// + /// Value must be a path to PEM-formatted certificates. The first certificate should certify the + /// KEYFILE supplied by --ssl-key-path. The last certificate should be a root CA. #[serde(skip_serializing)] #[clap(long, env = MEILI_SSL_CERT_PATH, parse(from_os_str))] pub ssl_cert_path: Option, - /// Read the private key from KEYFILE. This should be an RSA - /// private key or PKCS8-encoded private key, in PEM format. + /// Sets the server's SSL key files. + /// + /// Value must be a path to an RSA private key or PKCS8-encoded private key, both in PEM format. #[serde(skip_serializing)] #[clap(long, env = MEILI_SSL_KEY_PATH, parse(from_os_str))] pub ssl_key_path: Option, - /// Enable client authentication, and accept certificates - /// signed by those roots provided in CERTFILE. + /// Enables client authentication in the specified path. #[serde(skip_serializing)] #[clap(long, env = MEILI_SSL_AUTH_PATH, parse(from_os_str))] pub ssl_auth_path: Option, @@ -136,28 +161,42 @@ pub struct Opt { #[clap(long, env = MEILI_SSL_OCSP_PATH, parse(from_os_str))] pub ssl_ocsp_path: Option, - /// Send a fatal alert if the client does not complete client authentication. + /// Makes SSL authentication mandatory. + /// + /// Sends a fatal alert if the client does not complete client authentication. #[serde(skip_serializing, default)] #[clap(long, env = MEILI_SSL_REQUIRE_AUTH)] pub ssl_require_auth: bool, - /// SSL support session resumption + /// Activates SSL session resumption. #[serde(skip_serializing, default)] #[clap(long, env = MEILI_SSL_RESUMPTION)] pub ssl_resumption: bool, - /// SSL support tickets. + /// Activates SSL tickets. #[serde(skip_serializing, default)] #[clap(long, env = MEILI_SSL_TICKETS)] pub ssl_tickets: bool, - /// Defines the path of the snapshot file to import. - /// This option will, by default, stop the process if a database already exists, or if no snapshot exists at - /// the given path. If this option is not specified, no snapshot is imported. + /// Launches Meilisearch after importing a previously-generated snapshot at the given filepath. + /// + /// This command will throw an error if: + /// * A database already exists + /// * No valid snapshot can be found in the specified path + /// + /// This behavior can be modified with the `--ignore-snapshot-if-db-exists` and + /// `--ignore-missing-snapshot` options, respectively. + /// + /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IMPORT_SNAPSHOT)] pub import_snapshot: Option, - /// The engine will ignore a missing snapshot and not return an error in such a case. + /// Prevents a Meilisearch instance from throwing an error when `--import-snapshot` + /// does not point to a valid snapshot file. + /// + /// This command will throw an error if `--import-snapshot` is not defined. + /// + /// *This option is not available as an environment variable.* #[clap( long, env = MEILI_IGNORE_MISSING_SNAPSHOT, @@ -166,7 +205,13 @@ pub struct Opt { #[serde(default)] pub ignore_missing_snapshot: bool, - /// The engine will skip snapshot importation and not return an error in such case. + /// Prevents a Meilisearch instance with an existing database from throwing an + /// error when using `--import-snapshot`. Instead, the snapshot will be ignored + /// and Meilisearch will launch using the existing database. + /// + /// This command will throw an error if `--import-snapshot` is not defined. + /// + /// *This option is not available as an environment variable.* #[clap( long, env = MEILI_IGNORE_SNAPSHOT_IF_DB_EXISTS, @@ -175,20 +220,19 @@ pub struct Opt { #[serde(default)] pub ignore_snapshot_if_db_exists: bool, - /// Defines the directory path where Meilisearch will create a snapshot each snapshot-interval-sec. + /// Sets the directory where Meilisearch will store snapshots. #[clap(long, env = MEILI_SNAPSHOT_DIR, default_value_os_t = default_snapshot_dir())] #[serde(default = "default_snapshot_dir")] pub snapshot_dir: PathBuf, - /// Activate snapshot scheduling. + /// Activates scheduled snapshots when provided. Snapshots are disabled by default. #[clap(long, env = MEILI_SCHEDULE_SNAPSHOT)] #[serde(default)] pub schedule_snapshot: bool, - /// Defines time interval, in seconds, between each snapshot creation. + /// Defines the interval between each snapshot. Value must be given in seconds. #[clap(long, env = MEILI_SNAPSHOT_INTERVAL_SEC, default_value_t = default_snapshot_interval_sec())] #[serde(default = "default_snapshot_interval_sec")] - // 24h pub snapshot_interval_sec: u64, /// Import a dump from the specified path, must be a `.dump` file. From 458775c7add8731f6787c0b3206af0a64f0e7f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Mon, 3 Oct 2022 16:37:16 +0200 Subject: [PATCH 2/8] docs: add missing options --- meilisearch-http/src/option.rs | 35 ++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index 8a0ea0f44..bbbbd68de 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -235,16 +235,33 @@ pub struct Opt { #[serde(default = "default_snapshot_interval_sec")] pub snapshot_interval_sec: u64, - /// Import a dump from the specified path, must be a `.dump` file. + /// Imports the dump file located at the specified path. Path must point to a `.dump` file. + /// If a database already exists, Meilisearch will throw an error and abort launch. + /// + /// Meilisearch will only launch once the dump data has been fully indexed. + /// The time this takes depends on the size of the dump file. + /// + /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IMPORT_DUMP, conflicts_with = "import-snapshot")] pub import_dump: Option, - /// If the dump doesn't exist, load or create the database specified by `db-path` instead. + /// Prevents Meilisearch from throwing an error when `--import-dump` does not point to + /// a valid dump file. Instead, Meilisearch will start normally without importing any dump. + /// + /// This option will trigger an error if `--import-dump` is not defined. + /// + /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IGNORE_MISSING_DUMP, requires = "import-dump")] #[serde(default)] pub ignore_missing_dump: bool, - /// Ignore the dump if a database already exists, and load that database instead. + /// Prevents a Meilisearch instance with an existing database from throwing an error + /// when using `--import-dump`. Instead, the dump will be ignored and Meilisearch will + /// launch using the existing database. + /// + /// This option will trigger an error if `--import-dump` is not defined. + /// + /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IGNORE_DUMP_IF_DB_EXISTS, requires = "import-dump")] #[serde(default)] pub ignore_dump_if_db_exists: bool, @@ -254,7 +271,17 @@ pub struct Opt { #[serde(default = "default_dumps_dir")] pub dumps_dir: PathBuf, - /// Set the log level. # Possible values: [ERROR, WARN, INFO, DEBUG, TRACE] + /// Defines how much detail should be present in Meilisearch's logs. + + /// Meilisearch currently supports four log levels, listed in order of increasing verbosity: + /// + /// `'ERROR'`: only log unexpected events indicating Meilisearch is not functioning as expected + /// `'WARN'`: log all unexpected events, regardless of their severity + /// `'INFO'`: log all events. This is the default value of --log-level + /// `'DEBUG'`: log all events and include detailed information on Meilisearch's internal processes. + /// Useful when diagnosing issues and debugging + /// `'TRACE'`: log all events and include even more detailed information on Meilisearch's internal processes. + /// We do not advise using this level as it is extremely verbose. Use `'DEBUG'` before considering `'TRACE'`. #[clap(long, env = MEILI_LOG_LEVEL, default_value_t = default_log_level())] #[serde(default = "default_log_level")] pub log_level: String, From a93e3dead3d61a77b8a8d0512c8521a123a3b4cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Tue, 4 Oct 2022 10:30:08 +0200 Subject: [PATCH 3/8] Update meilisearch-http/src/option.rs Co-authored-by: Tommy <68053732+dichotommy@users.noreply.github.com> --- meilisearch-http/src/option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index bbbbd68de..eaf88b046 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -273,7 +273,7 @@ pub struct Opt { /// Defines how much detail should be present in Meilisearch's logs. - /// Meilisearch currently supports four log levels, listed in order of increasing verbosity: + /// Meilisearch currently supports five log levels, listed in order of increasing verbosity: /// /// `'ERROR'`: only log unexpected events indicating Meilisearch is not functioning as expected /// `'WARN'`: log all unexpected events, regardless of their severity From d1fdca2bcef937ce813d5b07cf0d590319b5094a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Wed, 5 Oct 2022 10:31:29 +0200 Subject: [PATCH 4/8] chore(fmt): cargo fmt --- meilisearch-http/src/option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index eaf88b046..77d4e9826 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -184,7 +184,7 @@ pub struct Opt { /// * A database already exists /// * No valid snapshot can be found in the specified path /// - /// This behavior can be modified with the `--ignore-snapshot-if-db-exists` and + /// This behavior can be modified with the `--ignore-snapshot-if-db-exists` and /// `--ignore-missing-snapshot` options, respectively. /// /// *This option is not available as an environment variable.* From 4a022acd33503f2e65a3009e783118193bf5273b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Wed, 5 Oct 2022 18:54:38 +0200 Subject: [PATCH 5/8] Update meilisearch-http/src/option.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Update meilisearch-http/src/option.rs Co-authored-by: Clémentine Urquizar - curqui Apply suggestions from code review Co-authored-by: Clémentine Urquizar - curqui --- meilisearch-http/src/option.rs | 67 +++------------------------------- 1 file changed, 5 insertions(+), 62 deletions(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index 77d4e9826..3d692ced9 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -81,20 +81,7 @@ pub struct Opt { #[clap(long, env = MEILI_MASTER_KEY)] pub master_key: Option, - /// Configures the instance's environment. Value must be either production or development. - /// `production` - /// * Setting a master key is mandatory - /// * The search preview interface is disabled - /// - /// `development`: - /// Setting a master key is optional - /// Search preview is enabled - /// - /// # TIP - /// - /// When the server environment is set to development, providing a master key is not mandatory. - /// This is useful when debugging and prototyping, but dangerous otherwise since API routes - /// are unprotected. + /// Configures the instance's environment. Value must be either `production` or `development`. #[clap(long, env = MEILI_ENV, default_value_t = default_env(), possible_values = &POSSIBLE_ENV)] #[serde(default = "default_env")] pub env: String, @@ -109,43 +96,29 @@ pub struct Opt { #[clap(long, env = MEILI_NO_ANALYTICS)] pub no_analytics: bool, - /// Sets the maximum size of the index. Value must be given in bytes or explicitly stating a base unit. - /// - /// For example, the default value can be written as `107374182400`, `'107.7Gb'`, or `'107374 Mb'`. - /// - /// The index stores processed data and is different from the task database, which handles pending tasks. + /// Sets the maximum size of the index. Value must be given in bytes or explicitly stating a base unit (for instance: 107374182400, '107.7Gb', or '107374 Mb'). #[clap(long, env = MEILI_MAX_INDEX_SIZE, default_value_t = default_max_index_size())] #[serde(default = "default_max_index_size")] pub max_index_size: Byte, /// Sets the maximum size of the task database. Value must be given in bytes or explicitly stating a - /// base unit. For example, the default value can be written as `107374182400`, `'107.7Gb'`, or - /// `'107374 Mb'`. - /// - /// The task database handles pending tasks. This is different from the index database, which only - /// stores processed data. + /// base unit (for instance: 107374182400, '107.7Gb', or '107374 Mb'). #[clap(long, env = MEILI_MAX_TASK_DB_SIZE, default_value_t = default_max_task_db_size())] #[serde(default = "default_max_task_db_size")] pub max_task_db_size: Byte, /// Sets the maximum size of accepted payloads. Value must be given in bytes or explicitly stating a - /// base unit. For example, the default value can be written as `107374182400`, `'107.7Gb'`, or - /// `'107374 Mb'`. + /// base unit (for instance: 107374182400, '107.7Gb', or '107374 Mb'). #[clap(long, env = MEILI_HTTP_PAYLOAD_SIZE_LIMIT, default_value_t = default_http_payload_size_limit())] #[serde(default = "default_http_payload_size_limit")] pub http_payload_size_limit: Byte, /// Sets the server's SSL certificates. - /// - /// Value must be a path to PEM-formatted certificates. The first certificate should certify the - /// KEYFILE supplied by --ssl-key-path. The last certificate should be a root CA. #[serde(skip_serializing)] #[clap(long, env = MEILI_SSL_CERT_PATH, parse(from_os_str))] pub ssl_cert_path: Option, /// Sets the server's SSL key files. - /// - /// Value must be a path to an RSA private key or PKCS8-encoded private key, both in PEM format. #[serde(skip_serializing)] #[clap(long, env = MEILI_SSL_KEY_PATH, parse(from_os_str))] pub ssl_key_path: Option, @@ -162,8 +135,6 @@ pub struct Opt { pub ssl_ocsp_path: Option, /// Makes SSL authentication mandatory. - /// - /// Sends a fatal alert if the client does not complete client authentication. #[serde(skip_serializing, default)] #[clap(long, env = MEILI_SSL_REQUIRE_AUTH)] pub ssl_require_auth: bool, @@ -179,15 +150,6 @@ pub struct Opt { pub ssl_tickets: bool, /// Launches Meilisearch after importing a previously-generated snapshot at the given filepath. - /// - /// This command will throw an error if: - /// * A database already exists - /// * No valid snapshot can be found in the specified path - /// - /// This behavior can be modified with the `--ignore-snapshot-if-db-exists` and - /// `--ignore-missing-snapshot` options, respectively. - /// - /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IMPORT_SNAPSHOT)] pub import_snapshot: Option, @@ -195,8 +157,6 @@ pub struct Opt { /// does not point to a valid snapshot file. /// /// This command will throw an error if `--import-snapshot` is not defined. - /// - /// *This option is not available as an environment variable.* #[clap( long, env = MEILI_IGNORE_MISSING_SNAPSHOT, @@ -210,8 +170,6 @@ pub struct Opt { /// and Meilisearch will launch using the existing database. /// /// This command will throw an error if `--import-snapshot` is not defined. - /// - /// *This option is not available as an environment variable.* #[clap( long, env = MEILI_IGNORE_SNAPSHOT_IF_DB_EXISTS, @@ -237,11 +195,6 @@ pub struct Opt { /// Imports the dump file located at the specified path. Path must point to a `.dump` file. /// If a database already exists, Meilisearch will throw an error and abort launch. - /// - /// Meilisearch will only launch once the dump data has been fully indexed. - /// The time this takes depends on the size of the dump file. - /// - /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IMPORT_DUMP, conflicts_with = "import-snapshot")] pub import_dump: Option, @@ -260,8 +213,6 @@ pub struct Opt { /// launch using the existing database. /// /// This option will trigger an error if `--import-dump` is not defined. - /// - /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IGNORE_DUMP_IF_DB_EXISTS, requires = "import-dump")] #[serde(default)] pub ignore_dump_if_db_exists: bool, @@ -272,16 +223,8 @@ pub struct Opt { pub dumps_dir: PathBuf, /// Defines how much detail should be present in Meilisearch's logs. - - /// Meilisearch currently supports five log levels, listed in order of increasing verbosity: /// - /// `'ERROR'`: only log unexpected events indicating Meilisearch is not functioning as expected - /// `'WARN'`: log all unexpected events, regardless of their severity - /// `'INFO'`: log all events. This is the default value of --log-level - /// `'DEBUG'`: log all events and include detailed information on Meilisearch's internal processes. - /// Useful when diagnosing issues and debugging - /// `'TRACE'`: log all events and include even more detailed information on Meilisearch's internal processes. - /// We do not advise using this level as it is extremely verbose. Use `'DEBUG'` before considering `'TRACE'`. + /// Meilisearch currently supports five log levels, listed in order of increasing verbosity: ERROR, WARN, INFO, DEBUG, TRACE. #[clap(long, env = MEILI_LOG_LEVEL, default_value_t = default_log_level())] #[serde(default = "default_log_level")] pub log_level: String, From 6933ba54fb7153e270bb576606d5d34cfef7345f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Wed, 5 Oct 2022 19:04:33 +0200 Subject: [PATCH 6/8] chore: add missing docs --- meilisearch-http/src/option.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index 3d692ced9..b23532065 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -71,12 +71,12 @@ pub struct Opt { #[serde(default = "default_db_path")] pub db_path: PathBuf, - /// The address on which the http server will listen. + /// Sets the HTTP address and port Meilisearch will use. #[clap(long, env = MEILI_HTTP_ADDR, default_value_t = default_http_addr())] #[serde(default = "default_http_addr")] pub http_addr: String, - /// Sets the instance's master key, automatically protecting all routes except GET /health + /// Sets the instance's master key, automatically protecting all routes except `GET /health`. #[serde(skip_serializing)] #[clap(long, env = MEILI_MASTER_KEY)] pub master_key: Option, @@ -128,8 +128,9 @@ pub struct Opt { #[clap(long, env = MEILI_SSL_AUTH_PATH, parse(from_os_str))] pub ssl_auth_path: Option, - /// Read DER-encoded OCSP response from OCSPFILE and staple to certificate. - /// Optional + /// Sets the server's OCSP file. *Optional* + /// + /// Reads DER-encoded OCSP response from OCSPFILE and staple to certificate. #[serde(skip_serializing)] #[clap(long, env = MEILI_SSL_OCSP_PATH, parse(from_os_str))] pub ssl_ocsp_path: Option, @@ -217,7 +218,7 @@ pub struct Opt { #[serde(default)] pub ignore_dump_if_db_exists: bool, - /// Folder where dumps are created when the dump route is called. + /// Sets the directory where Meilisearch will create dump files. #[clap(long, env = MEILI_DUMPS_DIR, default_value_os_t = default_dumps_dir())] #[serde(default = "default_dumps_dir")] pub dumps_dir: PathBuf, @@ -243,7 +244,7 @@ pub struct Opt { #[clap(flatten)] pub scheduler_options: SchedulerConfig, - /// The path to a configuration file that should be used to setup the engine. + /// Set the path to a configuration file that should be used to setup the engine. /// Format must be TOML. #[serde(skip_serializing)] #[clap(long)] From 8c526c31daad3cf0439b7484ef2f9957c93033e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Thu, 6 Oct 2022 15:08:37 +0200 Subject: [PATCH 7/8] Update meilisearch-http/src/option.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clémentine Urquizar - curqui --- meilisearch-http/src/option.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index b23532065..20af33f12 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -203,8 +203,6 @@ pub struct Opt { /// a valid dump file. Instead, Meilisearch will start normally without importing any dump. /// /// This option will trigger an error if `--import-dump` is not defined. - /// - /// *This option is not available as an environment variable.* #[clap(long, env = MEILI_IGNORE_MISSING_DUMP, requires = "import-dump")] #[serde(default)] pub ignore_missing_dump: bool, From abb02330774a73ee09f4a6cb1dce95a93267e865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Thu, 6 Oct 2022 15:14:56 +0200 Subject: [PATCH 8/8] chore: add docs of flattened structs --- meilisearch-lib/src/options.rs | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/meilisearch-lib/src/options.rs b/meilisearch-lib/src/options.rs index bd406fbdd..b84dd94a2 100644 --- a/meilisearch-lib/src/options.rs +++ b/meilisearch-lib/src/options.rs @@ -17,7 +17,7 @@ const DEFAULT_LOG_EVERY_N: usize = 100000; #[derive(Debug, Clone, Parser, Serialize, Deserialize)] #[serde(rename_all = "snake_case", deny_unknown_fields)] pub struct IndexerOpts { - /// The amount of documents to skip before printing + /// Sets the amount of documents to skip before printing /// a log regarding the indexing advancement. #[serde(skip_serializing, default = "default_log_every_n")] #[clap(long, default_value_t = default_log_every_n(), hide = true)] // 100k @@ -28,20 +28,15 @@ pub struct IndexerOpts { #[clap(long, hide = true)] pub max_nb_chunks: Option, - /// The maximum amount of memory the indexer will use. - /// - /// In case the engine is unable to retrieve the available memory the engine will - /// try to use the memory it needs but without real limit, this can lead to - /// Out-Of-Memory issues and it is recommended to specify the amount of memory to use. + /// Sets the maximum amount of RAM Meilisearch can use when indexing. By default, Meilisearch + /// uses no more than two thirds of available memory. #[clap(long, env = MEILI_MAX_INDEXING_MEMORY, default_value_t)] #[serde(default)] pub max_indexing_memory: MaxMemory, - /// The maximum number of threads the indexer will use. - /// If the number set is higher than the real number of cores available in the machine, - /// it will use the maximum number of available cores. - /// - /// It defaults to half of the available threads. + /// Sets the maximum number of threads Meilisearch can use during indexation. By default, the + /// indexer avoids using more than half of a machine's total processing units. This ensures + /// Meilisearch is always ready to perform searches, even while you are updating an index. #[clap(long, env = MEILI_MAX_INDEXING_THREADS, default_value_t)] #[serde(default)] pub max_indexing_threads: MaxThreads, @@ -50,8 +45,7 @@ pub struct IndexerOpts { #[derive(Debug, Clone, Parser, Default, Serialize, Deserialize)] #[serde(rename_all = "snake_case", deny_unknown_fields)] pub struct SchedulerConfig { - /// The engine will disable task auto-batching, - /// and will sequencialy compute each task one by one. + /// Deactivates auto-batching when provided. #[clap(long, env = DISABLE_AUTO_BATCHING)] #[serde(default)] pub disable_auto_batching: bool,