pub enum QuantizationType {
None,
Int8,
Int4,
Bbq,
}Expand description
Quantization scheme for dense_vector fields.
Configurable via the dense_vector field mapping:
{"embedding": {"type": "dense_vector", "dims": 768, "quantization": "int8"}}Recognized but unimplemented variants (Self::Int4, Self::Bbq)
are rejected at mapping parse time with LuciError::InvalidQuery.
The mapping API will not accept a value the engine cannot honor —
see [[code-must-not-lie]].
Variants§
None
No quantization — full float32 storage and scoring.
Int8
Int8 scalar quantization (8 bits/dim). 4× memory reduction with minimal recall loss in typical embedding workloads.
Int4
Int4 scalar quantization (4 bits/dim).
Recognized name; not yet implemented. Constructing a mapping
with this value returns LuciError::InvalidQuery.
Bbq
Better Binary Quantization (1 bit/dim with a correction term and oversampling-rerank).
Recognized name; not yet implemented. Constructing a mapping
with this value returns LuciError::InvalidQuery.
Implementations§
Source§impl QuantizationType
impl QuantizationType
Sourcepub const DEFAULT: Self = Self::Int8
pub const DEFAULT: Self = Self::Int8
The default quantization for dense_vector fields when the user
does not specify one.
Sourcepub fn from_es_name(name: &str) -> Result<Self>
pub fn from_es_name(name: &str) -> Result<Self>
Parse a quantization name from the mapping JSON quantization field.
Returns LuciError::InvalidQuery for both unknown names and
recognized-but-unimplemented values (int4, bbq). The error
message names the rejected value and the reason — the system
will never silently substitute a different quantization for the
one the user asked for.
Trait Implementations§
Source§impl Clone for QuantizationType
impl Clone for QuantizationType
Source§fn clone(&self) -> QuantizationType
fn clone(&self) -> QuantizationType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for QuantizationType
Source§impl Debug for QuantizationType
impl Debug for QuantizationType
impl Eq for QuantizationType
Source§impl Hash for QuantizationType
impl Hash for QuantizationType
Source§impl PartialEq for QuantizationType
impl PartialEq for QuantizationType
Source§fn eq(&self, other: &QuantizationType) -> bool
fn eq(&self, other: &QuantizationType) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for QuantizationType
Auto Trait Implementations§
impl Freeze for QuantizationType
impl RefUnwindSafe for QuantizationType
impl Send for QuantizationType
impl Sync for QuantizationType
impl Unpin for QuantizationType
impl UnsafeUnpin for QuantizationType
impl UnwindSafe for QuantizationType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more