From d590f4c6b0e837eb4c6c6af41811b778c22f3231 Mon Sep 17 00:00:00 2001 From: Paul Masurel Date: Thu, 6 Jun 2019 09:24:31 +0900 Subject: Comments for IndexMeta (#560) --- src/core/index_meta.rs | 13 +++++++++++++ src/lib.rs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/index_meta.rs b/src/core/index_meta.rs index 8927c54..eb50df6 100644 --- a/src/core/index_meta.rs +++ b/src/core/index_meta.rs @@ -14,14 +14,27 @@ use Opstamp; /// #[derive(Clone, Serialize, Deserialize)] pub struct IndexMeta { + /// List of `SegmentMeta` informations associated to each finalized segment of the index. pub segments: Vec, + /// Index `Schema` pub schema: Schema, + /// Opstamp associated to the last `commit` operation. pub opstamp: Opstamp, #[serde(skip_serializing_if = "Option::is_none")] + /// Payload associated to the last commit. + /// + /// Upon commit, clients can optionally add a small `Striing` payload to their commit + /// to help identify this commit. + /// This payload is entirely unused by tantivy. pub payload: Option, } impl IndexMeta { + /// Create an `IndexMeta` object representing a brand new `Index` + /// with the given index. + /// + /// This new index does not contains any segments. + /// Opstamp will the value `0u64`. pub fn with_schema(schema: Schema) -> IndexMeta { IndexMeta { segments: vec![], diff --git a/src/lib.rs b/src/lib.rs index a2ff4a0..6e7e34e 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -226,7 +226,7 @@ mod docset; pub use self::docset::{DocSet, SkipResult}; pub use core::SegmentComponent; -pub use core::{Index, Searcher, Segment, SegmentId, SegmentMeta, IndexMeta}; +pub use core::{Index, IndexMeta, Searcher, Segment, SegmentId, SegmentMeta}; pub use core::{InvertedIndexReader, SegmentReader}; pub use directory::Directory; pub use indexer::IndexWriter; -- cgit v1.2.3