Struct tantivy::postings::FieldSerializer
[−]
[src]
pub struct FieldSerializer<'a> { /* fields omitted */ }
The field serializer is in charge of the serialization of a specific field.
Methods
impl<'a> FieldSerializer<'a>
[src]
pub fn new_term(&mut self, term: &[u8]) -> Result<()>
[src]
Starts the postings for a new term.
- term - the term. It needs to come after the previous term according to the lexicographical order.
- doc_freq - return the number of document containing the term.
pub fn write_doc(
&mut self,
doc_id: DocId,
term_freq: u32,
position_deltas: &[u32]
) -> Result<()>
[src]
&mut self,
doc_id: DocId,
term_freq: u32,
position_deltas: &[u32]
) -> Result<()>
Serialize the information that a document contains the current term, its term frequency, and the position deltas.
At this point, the positions are already delta-encoded
.
For instance, if the positions are 2, 3, 17
,
position_deltas
is 2, 1, 14
Term frequencies and positions may be ignored by the serializer depending
on the configuration of the field in the Schema
.
pub fn close_term(&mut self) -> Result<()>
[src]
Finish the serialization for this term postings.
If the current block is incomplete, it need to be encoded
using VInt
encoding.
pub fn close(self) -> Result<()>
[src]
Closes the current current field.