Struct tantivy::fieldnorm::FieldNormReader [−][src]
pub struct FieldNormReader(_);
Expand description
Reads the fieldnorm associated to a document. The fieldnorm represents the length associated to a given Field of a given document.
This metric is important to compute the score of a document : a document having a query word in one its short fields (e.g. title) is likely to be more relevant than in one of its longer field (e.g. body).
tantivy encodes fieldnorm
on one byte with some precision loss,
using the same scheme as Lucene. Each value is place on a log-scale
that takes values from 0
to 255
.
A value on this scale is identified by a fieldnorm_id
.
Apart from compression, this scale also makes it possible to
precompute computationally expensive functions of the fieldnorm
in a very short array.
Implementations
Creates a FieldNormReader
with a constant fieldnorm.
The fieldnorm will be subjected to compression as if it was coming from an array-backed fieldnorm reader.
Opens a field norm reader given its file.
Returns the fieldnorm
associated to a doc id.
The fieldnorm is a value approximating the number
of tokens in a given field of the doc_id
.
It is imprecise, and equal or lower than the actual number of tokens.
The fieldnorm is effectively decoded from the
fieldnorm_id
by doing a simple table lookup.
Returns the fieldnorm_id
associated to a document.
Converts a fieldnorm_id
into a fieldnorm.
Converts a fieldnorm
into a fieldnorm_id
.
(This function is not injective).
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for FieldNormReader
impl Send for FieldNormReader
impl Sync for FieldNormReader
impl Unpin for FieldNormReader
impl !UnwindSafe for FieldNormReader
Blanket Implementations
Mutably borrows from an owned value. Read more
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
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
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
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