[−][src]Struct tantivy::fastfield::MultiValueIntFastFieldWriter
Writer for multi-valued (as in, more than one value per document) int fast field.
This Writer
is only useful for advanced user.
The normal way to get your multivalued int in your index
is to
- declare your field with fast set to
Cardinality::MultiValues
in your schema - add your document simply by calling
.add_document(...)
.
The MultiValueIntFastFieldWriter
can be acquired from the
fastfield writer, by calling .get_multivalue_writer(...)
.
Once acquired, writing is done by calling calls to
.add_document_vals(&[u64])
once per document.
The serializer makes it possible to remap all of the values that were pushed to the writer using a mapping. This makes it possible to push unordered term ids, during indexing and remap them to their respective term ids when the segment is getting serialized.
Methods
impl MultiValueIntFastFieldWriter
[src]
pub fn field(&self) -> Field
[src]
Access the field associated to the MultiValueIntFastFieldWriter
pub fn add_document(&mut self, doc: &Document)
[src]
Shift to the next document and adds all of the matching field values present in the document.
pub fn add_document_vals(&mut self, vals: &[u64]) -> DocId
[src]
Register all of the values associated to a document.
The method returns the DocId
of the document that was
just written.
pub fn serialize(
&self,
serializer: &mut FastFieldSerializer,
mapping_opt: Option<&FnvHashMap<u64, TermOrdinal>>
) -> Result<()>
[src]
&self,
serializer: &mut FastFieldSerializer,
mapping_opt: Option<&FnvHashMap<u64, TermOrdinal>>
) -> Result<()>
Serializes fast field values by pushing them to the FastFieldSerializer
.
If a mapping is given, the values are remapped and sorted before serialization.
This is used when serializing facets
. Specifically their terms are
first stored in the writer as their position in the IndexWriter
's HashMap
.
This value is called an UnorderedTermId
.
During the serialization of the segment, terms gets sorted and
tantivy
builds a mapping to convert this UnorderedTermId
into
term ordinals.
Auto Trait Implementations
impl RefUnwindSafe for MultiValueIntFastFieldWriter
impl Send for MultiValueIntFastFieldWriter
impl Sync for MultiValueIntFastFieldWriter
impl Unpin for MultiValueIntFastFieldWriter
impl UnwindSafe for MultiValueIntFastFieldWriter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T> Fruit for T where
T: Send + Downcast,
[src]
T: Send + Downcast,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,