summaryrefslogtreecommitdiffstats
path: root/src/core/index_meta.rs
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/core/index_meta.rs
parentedfa6195190910e9d1beff61a7a1fcf7db42fccd (diff)
Comments for IndexMeta (#560)
Diffstat (limited to 'src/core/index_meta.rs')
-rw-r--r--src/core/index_meta.rs13
1 files changed, 13 insertions, 0 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![],