pub fn writer_with_num_threads(
        &self,
        num_threads: usize,
        overall_heap_size_in_bytes: usize,
    ) -> Result<IndexWriter> {
        let directory_lock = self
            .directory
            .acquire_lock(&INDEX_WRITER_LOCK)
            .map_err(|err| {
                TantivyError::LockFailure(
                    err,
                    Some(
                        "Failed to acquire index lock. If you are using\
                         a regular directory, this means there is already an \
                         `IndexWriter` working on this `Directory`, in this process \
                         or in a different process."
                            .to_string(),
                    ),
                )
            })?;
        let heap_size_in_bytes_per_thread = overall_heap_size_in_bytes / num_threads;
        IndexWriter::new(
            self,
            num_threads,
            heap_size_in_bytes_per_thread,
            directory_lock,
        )
    }
/// Open a new index writer. Attempts to acquire a lockfile.
///
/// The lockfile should be deleted on drop, but it is possible
/// that due to a panic or other error, a stale lockfile will be
/// left in the index directory. If you are sure that no other
/// `IndexWriter` on the system is accessing the index directory,
/// it is safe to manually delete the lockfile.
///
/// - `num_threads` defines the number of indexing workers that
/// should work at the same time.
///
/// - `overall_heap_size_in_bytes` sets the amount of memory
/// allocated for all indexing thread.
/// Each thread will receive a budget of  `overall_heap_size_in_bytes / num_threads`.
///
/// # Errors
/// If the lockfile already exists, returns `Error::DirectoryLockBusy` or an `Error::IOError`.
///
/// # Panics
/// If the heap size per thread is too small, panics.
Open a new index writer. Attempts to acquire a lockfile.
The lockfile should be deleted on drop, but it is possible
that due to a panic or other error, a stale lockfile will be
left in the index directory. If you are sure that no other
`IndexWriter` on the system is accessing the index directory,
it is safe to manually delete the lockfile.

`num_threads` defines the number of indexing workers that
should work at the same time.

`overall_heap_size_in_bytes` sets the amount of memory
allocated for all indexing thread.
Each thread will receive a budget of  `overall_heap_size_in_bytes / num_threads`.
Open a new index writer . Attempts to acquire a lockfile . The lockfile should be deleted on drop but it is possible that due to a panic or other error a stale lockfile will be left in the index directory . If you are sure that no other ` IndexWriter ` on the system is accessing the index directory it is safe to manually delete the lockfile . ` num_threads ` defines the number of indexing workers that should work at the same time . ` overall_heap_size_in_bytes ` sets the amount of memory allocated for all indexing thread . Each thread will receive a budget of ` overall_heap_size_in_bytes / num_threads ` .
pub fn writer_with_num_threads(
        &self,
        num_threads: usize,
        overall_heap_size_in_bytes: usize,
    ) -> Result<IndexWriter> {
        let directory_lock = self
            .directory
            .acquire_lock(&INDEX_WRITER_LOCK)
            .map_err(|err| {
                TantivyError::LockFailure(
                    err,
                    Some(
                        "Failed to acquire index lock. If you are using\
                         a regular directory, this means there is already an \
                         `IndexWriter` working on this `Directory`, in this process \
                         or in a different process."
                            .to_string(),
                    ),
                )
            })?;
        let heap_size_in_bytes_per_thread = overall_heap_size_in_bytes / num_threads;
        IndexWriter::new(
            self,
            num_threads,
            heap_size_in_bytes_per_thread,
            directory_lock,
        )
    }
pub fn writer_with_num_threads ( & self , num_threads : usize , overall_heap_size_in_bytes : usize , ) -> Result < IndexWriter > { let directory_lock = self . directory . acquire_lock ( & INDEX_WRITER_LOCK ) . map_err ( | err | { TantivyError :: LockFailure ( err , Some ( " \
 \
 \
 " . to_string ( ) , ) , ) } ) ? ; let heap_size_in_bytes_per_thread = overall_heap_size_in_bytes / num_threads ; IndexWriter :: new ( self , num_threads , heap_size_in_bytes_per_thread , directory_lock , ) }
Open a new index writer.
Open a new index writer .
&self
num_threads
usize
overall_heap_size_in_bytes
usize
&self
num_threads
usize
overall_heap_size_in_bytes
usize
errors
If the lockfile already exists, returns `Error::DirectoryLockBusy` or an `Error::IOError`.
If the lockfile already exists returns ` Error :: DirectoryLockBusy ` or an ` Error :: IOError ` .
panics
If the heap size per thread is too small, panics.
If the heap size per thread is too small panics .