Struct tantivy::DemuxMapping
source · [−]pub struct DemuxMapping { /* private fields */ }
Expand description
DemuxMapping can be used to reorganize data from multiple segments.
DemuxMapping is useful in a multitenant settings, in which each document might actually belong to a different tenant. It allows to reorganize documents as follows:
e.g. if you have two tenant ids TENANT_A and TENANT_B and two segments with the documents (simplified) Seg 1 [TENANT_A, TENANT_B] Seg 2 [TENANT_A, TENANT_B]
You may want to group your documents to Seg 1 [TENANT_A, TENANT_A] Seg 2 [TENANT_B, TENANT_B]
Demuxing is the tool for that. Semantically you can define a mapping from [old segment ordinal, old doc_id] -> [new segment ordinal].
Implementations
sourceimpl DemuxMapping
impl DemuxMapping
sourcepub fn add(&mut self, segment_mapping: DocIdToSegmentOrdinal)
pub fn add(&mut self, segment_mapping: DocIdToSegmentOrdinal)
Adds a DocIdToSegmentOrdinal. The order of the pus calls defines the old segment ordinal. e.g. first push = ordinal 0.
sourcepub fn get_old_num_segments(&self) -> usize
pub fn get_old_num_segments(&self) -> usize
Returns the old number of segments.
Trait Implementations
sourceimpl Debug for DemuxMapping
impl Debug for DemuxMapping
sourceimpl Default for DemuxMapping
impl Default for DemuxMapping
sourcefn default() -> DemuxMapping
fn default() -> DemuxMapping
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for DemuxMapping
impl Send for DemuxMapping
impl Sync for DemuxMapping
impl Unpin for DemuxMapping
impl UnwindSafe for DemuxMapping
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more