Introduce a new experimental document compression parameter

This commit is contained in:
Kerollmops 2025-01-15 16:40:38 +01:00
parent 02f468afb7
commit 049072b8be
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F
2 changed files with 15 additions and 0 deletions

View File

@ -194,6 +194,7 @@ struct Infos {
experimental_enable_logs_route: bool,
experimental_reduce_indexing_memory_usage: bool,
experimental_max_number_of_batched_tasks: usize,
experimental_enable_document_compression: bool,
gpu_enabled: bool,
db_path: bool,
import_dump: bool,
@ -239,6 +240,7 @@ impl Infos {
experimental_enable_logs_route,
experimental_reduce_indexing_memory_usage,
experimental_max_number_of_batched_tasks,
experimental_enable_document_compression,
http_addr,
master_key: _,
env,
@ -300,6 +302,7 @@ impl Infos {
experimental_replication_parameters,
experimental_enable_logs_route: experimental_enable_logs_route | logs_route,
experimental_reduce_indexing_memory_usage,
experimental_enable_document_compression,
gpu_enabled: meilisearch_types::milli::vector::is_cuda_enabled(),
db_path: db_path != PathBuf::from("./data.ms"),
import_dump: import_dump.is_some(),

View File

@ -60,6 +60,8 @@ const MEILI_EXPERIMENTAL_REDUCE_INDEXING_MEMORY_USAGE: &str =
"MEILI_EXPERIMENTAL_REDUCE_INDEXING_MEMORY_USAGE";
const MEILI_EXPERIMENTAL_MAX_NUMBER_OF_BATCHED_TASKS: &str =
"MEILI_EXPERIMENTAL_MAX_NUMBER_OF_BATCHED_TASKS";
const MEILI_EXPERIMENTAL_ENABLE_DOCUMENT_COMPRESSION: &str =
"MEILI_EXPERIMENTAL_ENABLE_DOCUMENT_COMPRESSION";
const DEFAULT_CONFIG_FILE_PATH: &str = "./config.toml";
const DEFAULT_DB_PATH: &str = "./data.ms";
@ -411,6 +413,11 @@ pub struct Opt {
#[serde(default = "default_limit_batched_tasks")]
pub experimental_max_number_of_batched_tasks: usize,
/// Experimentally enable the document compression feature, see: <https://github.com/orgs/meilisearch/discussions/802>
#[clap(long, env = MEILI_EXPERIMENTAL_ENABLE_DOCUMENT_COMPRESSION)]
#[serde(default)]
pub experimental_enable_document_compression: bool,
#[serde(flatten)]
#[clap(flatten)]
pub indexer_options: IndexerOpts,
@ -512,6 +519,7 @@ impl Opt {
experimental_enable_logs_route,
experimental_replication_parameters,
experimental_reduce_indexing_memory_usage,
experimental_enable_document_compression,
} = self;
export_to_env_if_not_present(MEILI_DB_PATH, db_path);
export_to_env_if_not_present(MEILI_HTTP_ADDR, http_addr);
@ -596,6 +604,10 @@ impl Opt {
MEILI_EXPERIMENTAL_REDUCE_INDEXING_MEMORY_USAGE,
experimental_reduce_indexing_memory_usage.to_string(),
);
export_to_env_if_not_present(
MEILI_EXPERIMENTAL_ENABLE_DOCUMENT_COMPRESSION,
experimental_enable_document_compression.to_string(),
);
indexer_options.export_to_env();
}