summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Masurel <paul.masurel@gmail.com>2019-06-06 09:24:31 +0900
committerGitHub <noreply@github.com>2019-06-06 09:24:31 +0900
commitd590f4c6b0e837eb4c6c6af41811b778c22f3231 (patch)
treeef2978ce6eca29dc48e7506ead7496f1c96968c3 /src
parentedfa6195190910e9d1beff61a7a1fcf7db42fccd (diff)
Comments for IndexMeta (#560)
Diffstat (limited to 'src')
-rw-r--r--src/core/index_meta.rs13
-rwxr-xr-xsrc/lib.rs2
2 files changed, 14 insertions, 1 deletions
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<SegmentMeta>,
+ /// 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<String>,
}
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;