From 8f5ac86f307ea64fb325992918ebd4ba081ba493 Mon Sep 17 00:00:00 2001 From: Paul Horn Date: Sun, 29 Dec 2019 14:37:13 +0100 Subject: [PATCH] Expose UserOperation as a public type. (#744) In order to make `IndexWriter::run` callable from outside of the create, the `UserOperation` type needs to be publicly available. Since the `indexer` module is private, we just export the `UserOperation` type directly. --- src/indexer/operation.rs | 2 ++ src/lib.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/indexer/operation.rs b/src/indexer/operation.rs index 597fc4e3e..d59d7781e 100644 --- a/src/indexer/operation.rs +++ b/src/indexer/operation.rs @@ -19,6 +19,8 @@ pub struct AddOperation { /// UserOperation is an enum type that encapsulates other operation types. #[derive(Eq, PartialEq, Debug)] pub enum UserOperation { + /// Add operation Add(Document), + /// Delete operation Delete(Term), } diff --git a/src/lib.rs b/src/lib.rs index 5db79a1ed..cbb47bf9f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -166,6 +166,7 @@ pub use crate::core::{Index, IndexMeta, Searcher, Segment, SegmentId, SegmentMet pub use crate::core::{InvertedIndexReader, SegmentReader}; pub use crate::directory::Directory; pub use crate::indexer::IndexWriter; +pub use crate::indexer::operation::UserOperation; pub use crate::postings::Postings; pub use crate::reader::LeasedItem; pub use crate::schema::{Document, Term};