Struct tantivy::postings::InvertedIndexSerializer
source · pub struct InvertedIndexSerializer { /* private fields */ }
Expand description
InvertedIndexSerializer
is in charge of serializing
postings on disk, in the
.idx
(inverted index).pos
(positions file).term
(term dictionary)
PostingsWriter
are in charge of pushing the data to the
serializer.
The serializer expects to receive the following calls in this order :
set_field(...)
new_term(...)
write_doc(...)
write_doc(...)
write_doc(...)
- …
close_term()
new_term(...)
write_doc(...)
- …
close_term()
set_field(...)
- …
close()
Terms have to be pushed in a lexicographically-sorted order. Within a term, documents have to be pushed in increasing order.
A description of the serialization format is available here.
Implementations§
source§impl InvertedIndexSerializer
impl InvertedIndexSerializer
sourcepub fn open(segment: &mut Segment) -> Result<InvertedIndexSerializer>
pub fn open(segment: &mut Segment) -> Result<InvertedIndexSerializer>
Open a new InvertedIndexSerializer
for the given segment
sourcepub fn new_field(
&mut self,
field: Field,
total_num_tokens: u64,
fieldnorm_reader: Option<FieldNormReader>
) -> Result<FieldSerializer<'_>>
pub fn new_field( &mut self, field: Field, total_num_tokens: u64, fieldnorm_reader: Option<FieldNormReader> ) -> Result<FieldSerializer<'_>>
Must be called before starting pushing terms of a given field.
Loads the indexing options for the given field.
Auto Trait Implementations§
impl Freeze for InvertedIndexSerializer
impl !RefUnwindSafe for InvertedIndexSerializer
impl Send for InvertedIndexSerializer
impl Sync for InvertedIndexSerializer
impl Unpin for InvertedIndexSerializer
impl !UnwindSafe for InvertedIndexSerializer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn 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.source§fn 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.