add index accessor for index writer (#1159)

* add index accessor for index writer

* Update src/indexer/index_writer.rs

Co-authored-by: Paul Masurel <paul@quickwit.io>
This commit is contained in:
Mestery
2021-09-23 14:49:20 +02:00
committed by GitHub
parent 37c5fe3c86
commit b256df6599

View File

@@ -348,6 +348,13 @@ impl IndexWriter {
self.operation_sender = sender;
}
/// Accessor to the index
///
/// The index is actually cloned.
pub fn index(&self) -> &Index {
&self.index
}
/// If there are some merging threads, blocks until they all finish their work and
/// then drop the `IndexWriter`.
pub fn wait_merging_threads(mut self) -> crate::Result<()> {