[][src]Struct tantivy::fieldnorm::FieldNormsWriter

pub struct FieldNormsWriter { /* fields omitted */ }

The FieldNormsWriter is in charge of tracking the fieldnorm byte of each document for each field with field norms.

FieldNormsWriter stores a Vec for each tracked field, using a byte per document per field.

Methods

impl FieldNormsWriter[src]

pub fn for_schema(schema: &Schema) -> FieldNormsWriter[src]

Initialize with state for tracking the field norm fields specified in the schema.

pub fn fill_up_to_max_doc(&mut self, max_doc: DocId)[src]

Ensure that all documents in 0..max_doc have a byte associated with them in each of the fieldnorm vectors.

Will extend with 0-bytes for documents that have not been seen.

pub fn record(&mut self, doc: DocId, field: Field, fieldnorm: u32)[src]

Set the fieldnorm byte for the given document for the given field.

Will internally convert the u32 fieldnorm value to the appropriate byte to approximate the field norm in less space.

  • doc - the document id
  • field - the field being set
  • fieldnorm - the number of terms present in document doc in field field

pub fn serialize(
    &self,
    fieldnorms_serializer: &mut FieldNormsSerializer
) -> Result<()>
[src]

Serialize the seen fieldnorm values to the serializer for all fields.

Auto Trait Implementations

Blanket Implementations

impl<T> Fruit for T where
    T: Send + Downcast
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Downcast for T where
    T: Any
[src]