Increase default writer heap (fixes #118) (#121)

master
Caleb Hattingh 2023-09-10 22:57:57 +02:00 committed by GitHub
parent e7ffccc57b
commit 91a422b49e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -243,14 +243,19 @@ impl Index {
/// split between the given number of threads. /// split between the given number of threads.
/// ///
/// Args: /// Args:
/// overall_heap_size (int, optional): The total target memory usage of /// overall_heap_size (int, optional): The total target heap memory usage of
/// the writer, can't be less than 3000000. /// 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 /// num_threads (int, optional): The number of threads that the writer
/// should use. If this value is 0, tantivy will choose /// should use. If this value is 0, tantivy will choose
/// automatically the number of threads. /// automatically the number of threads.
/// ///
/// Raises ValueError if there was an error while creating the writer. /// 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( fn writer(
&self, &self,
heap_size: usize, heap_size: usize,