pub fn writer(&self, overall_heap_size_in_bytes: usize) -> Result<IndexWriter> {
        let mut num_threads = num_cpus::get();
        let heap_size_in_bytes_per_thread = overall_heap_size_in_bytes / num_threads;
        if heap_size_in_bytes_per_thread < HEAP_SIZE_MIN {
            num_threads = (overall_heap_size_in_bytes / HEAP_SIZE_MIN).max(1);
        }
        self.writer_with_num_threads(num_threads, overall_heap_size_in_bytes)
    }
/// Creates a multithreaded writer
///
/// Tantivy will automatically define the number of threads to use.
/// `overall_heap_size_in_bytes` is the total target memory usage that will be split
/// between a given number of threads.
///
/// # Errors
/// If the lockfile already exists, returns `Error::FileAlreadyExists`.
/// # Panics
/// If the heap size per thread is too small, panics.
Creates a multithreaded writer
Tantivy will automatically define the number of threads to use.
`overall_heap_size_in_bytes` is the total target memory usage that will be split
between a given number of threads.
Creates a multithreaded writer Tantivy will automatically define the number of threads to use . ` overall_heap_size_in_bytes ` is the total target memory usage that will be split between a given number of threads .
pub fn writer(&self, overall_heap_size_in_bytes: usize) -> Result<IndexWriter> {
        let mut num_threads = num_cpus::get();
        let heap_size_in_bytes_per_thread = overall_heap_size_in_bytes / num_threads;
        if heap_size_in_bytes_per_thread < HEAP_SIZE_MIN {
            num_threads = (overall_heap_size_in_bytes / HEAP_SIZE_MIN).max(1);
        }
        self.writer_with_num_threads(num_threads, overall_heap_size_in_bytes)
    }
pub fn writer ( & self , overall_heap_size_in_bytes : usize ) -> Result < IndexWriter > { let mut num_threads = num_cpus :: get ( ) ; let heap_size_in_bytes_per_thread = overall_heap_size_in_bytes / num_threads ; if heap_size_in_bytes_per_thread < HEAP_SIZE_MIN { num_threads = ( overall_heap_size_in_bytes / HEAP_SIZE_MIN ) . max ( 1 ) ; } self . writer_with_num_threads ( num_threads , overall_heap_size_in_bytes ) }
Creates a multithreaded writer
Tantivy will automatically define the number of threads to use.
Creates a multithreaded writer Tantivy will automatically define the number of threads to use .
&self
overall_heap_size_in_bytes
usize
&self
overall_heap_size_in_bytes
usize
errors
If the lockfile already exists, returns `Error::FileAlreadyExists`.
If the lockfile already exists returns ` Error :: FileAlreadyExists ` .
panics
If the heap size per thread is too small, panics.
If the heap size per thread is too small panics .