diff --git a/meilisearch/src/analytics/segment_analytics.rs b/meilisearch/src/analytics/segment_analytics.rs index 99298bd43..b334f651d 100644 --- a/meilisearch/src/analytics/segment_analytics.rs +++ b/meilisearch/src/analytics/segment_analytics.rs @@ -252,6 +252,7 @@ impl super::Analytics for SegmentAnalytics { struct Infos { env: String, experimental_enable_metrics: bool, + experimental_search_queue_size: usize, experimental_logs_mode: LogMode, experimental_replication_parameters: bool, experimental_enable_logs_route: bool, @@ -293,6 +294,7 @@ impl From for Infos { let Opt { db_path, experimental_enable_metrics, + experimental_search_queue_size, experimental_logs_mode, experimental_replication_parameters, experimental_enable_logs_route, @@ -342,6 +344,7 @@ impl From for Infos { Self { env, experimental_enable_metrics, + experimental_search_queue_size, experimental_logs_mode, experimental_replication_parameters, experimental_enable_logs_route, diff --git a/meilisearch/src/option.rs b/meilisearch/src/option.rs index 43bf2c62c..a9b8578bb 100644 --- a/meilisearch/src/option.rs +++ b/meilisearch/src/option.rs @@ -54,6 +54,7 @@ const MEILI_EXPERIMENTAL_LOGS_MODE: &str = "MEILI_EXPERIMENTAL_LOGS_MODE"; const MEILI_EXPERIMENTAL_REPLICATION_PARAMETERS: &str = "MEILI_EXPERIMENTAL_REPLICATION_PARAMETERS"; const MEILI_EXPERIMENTAL_ENABLE_LOGS_ROUTE: &str = "MEILI_EXPERIMENTAL_ENABLE_LOGS_ROUTE"; const MEILI_EXPERIMENTAL_ENABLE_METRICS: &str = "MEILI_EXPERIMENTAL_ENABLE_METRICS"; +const MEILI_EXPERIMENTAL_SEARCH_QUEUE_SIZE: &str = "MEILI_EXPERIMENTAL_SEARCH_QUEUE_SIZE"; const MEILI_EXPERIMENTAL_REDUCE_INDEXING_MEMORY_USAGE: &str = "MEILI_EXPERIMENTAL_REDUCE_INDEXING_MEMORY_USAGE"; const MEILI_EXPERIMENTAL_MAX_NUMBER_OF_BATCHED_TASKS: &str = @@ -344,6 +345,16 @@ pub struct Opt { #[serde(default)] pub experimental_enable_metrics: bool, + /// TODO: Update the discussion link + /// Experimental search queue size. For more information, see: + /// + /// Lets you customize the size of the search queue. Meilisearch processes your search requests as fast as possible but once the + /// queue is full it starts returning HTTP 503, Service Unavailable. + /// The default value is 1000. + #[clap(long, env = MEILI_EXPERIMENTAL_SEARCH_QUEUE_SIZE, default_value_t = 1000)] + #[serde(default)] + pub experimental_search_queue_size: usize, + /// Experimental logs mode feature. For more information, see: /// /// Change the mode of the logs on the console. @@ -473,6 +484,7 @@ impl Opt { #[cfg(feature = "analytics")] no_analytics, experimental_enable_metrics, + experimental_search_queue_size, experimental_logs_mode, experimental_enable_logs_route, experimental_replication_parameters, @@ -532,6 +544,10 @@ impl Opt { MEILI_EXPERIMENTAL_ENABLE_METRICS, experimental_enable_metrics.to_string(), ); + export_to_env_if_not_present( + MEILI_EXPERIMENTAL_SEARCH_QUEUE_SIZE, + experimental_search_queue_size.to_string(), + ); export_to_env_if_not_present( MEILI_EXPERIMENTAL_LOGS_MODE, experimental_logs_mode.to_string(),