Exposing the remaining API

This commit is contained in:
Paul Masurel
2017-05-24 21:59:51 +09:00
parent 511bd25a31
commit 29bf740ddf
4 changed files with 29 additions and 4 deletions

View File

@@ -70,6 +70,10 @@ impl SegmentReader {
self.segment_meta.num_docs()
}
pub fn schema(&self) -> &Schema {
&self.schema
}
/// Return the number of documents that have been
/// deleted in the segment.
pub fn num_deleted_docs(&self) -> DocId {

View File

@@ -244,3 +244,8 @@ impl FastFieldsReader {
})
}
}
unsafe impl Send for U64FastFieldReader {}
unsafe impl Sync for U64FastFieldReader {}
unsafe impl Send for I64FastFieldReader {}
unsafe impl Sync for I64FastFieldReader {}

View File

@@ -346,6 +346,18 @@ impl IndexWriter {
result
}
#[doc(hidden)]
pub fn add_segment(&mut self, segment_meta: SegmentMeta) {
let delete_cursor = self.delete_queue.cursor();
let segment_entry = SegmentEntry::new(segment_meta, delete_cursor, None);
self.segment_updater.add_segment(self.generation, segment_entry);
}
#[doc(hidden)]
pub fn new_segment(&self) -> Segment {
self.segment_updater.new_segment()
}
/// Spawns a new worker thread for indexing.
/// The thread consumes documents from the pipeline.
///

View File

@@ -90,22 +90,25 @@ pub type Result<T> = std::result::Result<T, Error>;
mod core;
mod compression;
mod store;
mod indexer;
mod common;
pub mod common;
mod error;
mod analyzer;
mod datastruct;
pub mod termdict;
// Row-oriented, slow, compressed storage of documents
pub mod store;
/// Query module
pub mod query;
pub mod directory;
/// Collector module
pub mod collector;
/// Postings module (also called inverted index)
pub mod postings;
/// Schema
@@ -123,6 +126,7 @@ pub use self::common::TimerTree;
pub use postings::DocSet;
pub use postings::Postings;
pub use core::SegmentComponent;
pub use postings::SegmentPostingsOption;