From 91a422b49e5351af80a0d817955c2c12c425c089 Mon Sep 17 00:00:00 2001 From: Caleb Hattingh Date: Sun, 10 Sep 2023 22:57:57 +0200 Subject: [PATCH] Increase default writer heap (fixes #118) (#121) --- src/index.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/index.rs b/src/index.rs index cac739e0..478e6edd 100644 --- a/src/index.rs +++ b/src/index.rs @@ -243,14 +243,19 @@ impl Index { /// split between the given number of threads. /// /// Args: - /// overall_heap_size (int, optional): The total target memory usage of - /// the writer, can't be less than 3000000. + /// overall_heap_size (int, optional): The total target heap memory usage of + /// the writer. Tantivy requires that this can't be less + /// than 3000000 *per thread*. Lower values will result in more + /// frequent internal commits when adding documents (slowing down + /// write progress), and larger values will results in fewer + /// commits but greater memory usage. The best value will depend + /// on your specific use case. /// num_threads (int, optional): The number of threads that the writer /// should use. If this value is 0, tantivy will choose /// automatically the number of threads. /// /// Raises ValueError if there was an error while creating the writer. - #[pyo3(signature = (heap_size = 3000000, num_threads = 0))] + #[pyo3(signature = (heap_size = 128_000_000, num_threads = 0))] fn writer( &self, heap_size: usize,