pub struct EdgeConfig {
pub on_disk_payload: Option<bool>,
pub vectors: HashMap<String, EdgeVectorParams>,
pub sparse_vectors: HashMap<String, EdgeSparseVectorParams>,
pub hnsw_config: Option<HnswConfig>,
pub quantization_config: Option<QuantizationConfig>,
pub optimizers: Option<EdgeOptimizersConfig>,
pub wal_options: Option<WalOptions>,
pub max_search_threads: Option<usize>,
pub search_pool_core: Option<usize>,
}Expand description
Full configuration for an edge shard.
vectors and sparse_vectors define the stored data: when loading an existing shard they are
validated for compatibility against the segments if provided (non-empty), or taken from the
persisted config / the segments themselves if not.
Everything else is tunable and None means “not specified”: when loading an existing shard
each parameter resolves through provided → persisted → derived from segments → default (see
EdgeConfig::fill_unspecified_from), so leaving a parameter unspecified keeps the shard as
it is, while a Some value explicitly overwrites it and existing segments converge to it
through the optimizers.
Fields§
§on_disk_payload: Option<bool>If true, payload is stored on disk (mmap); otherwise in RAM. Same as CollectionParams::on_disk_payload.
None defaults to on-disk, see EdgeConfig::on_disk_payload.
vectors: HashMap<String, EdgeVectorParams>Dense vector params per vector name.
sparse_vectors: HashMap<String, EdgeSparseVectorParams>Sparse vector params per vector name.
hnsw_config: Option<HnswConfig>Global HNSW config; per-vector override is in vectors[].hnsw_config.
None defaults to HnswConfig::default, see EdgeConfig::hnsw_config.
quantization_config: Option<QuantizationConfig>Global quantization config for all vectors
Per-vector override in in vectors[].quantization_config
optimizers: Option<EdgeOptimizersConfig>None defaults to EdgeOptimizersConfig::default, see EdgeConfig::optimizers.
wal_options: Option<WalOptions>WAL options for the shard. None keeps the WAL crate’s defaults
(32 MiB segment capacity). Override for embedded/mobile deployments
where the default segment size is too large.
max_search_threads: Option<usize>Number of threads in the shard’s search thread pool. The pool executes per-segment reads
(search, scroll, count, facet, …) in parallel and loads segments in parallel. None (the
default) derives the count from the number of CPUs, matching the core search runtime — see
EdgeConfig::search_thread_count.
search_pool_core: Option<usize>Pin every thread of this shard’s search pool to the given CPU core: bounds the shard’s
search compute to one core while keeping the pool’s IO overlap. Best-effort. None (the
default) leaves thread placement to the OS scheduler.
Implementations§
Source§impl EdgeConfig
impl EdgeConfig
Sourcepub fn builder() -> EdgeConfigBuilder
pub fn builder() -> EdgeConfigBuilder
Start building an EdgeConfig with a fluent API.
Sourcepub fn on_disk_payload(&self) -> bool
pub fn on_disk_payload(&self) -> bool
Effective payload storage location: on-disk unless explicitly set to false.
Sourcepub fn hnsw_config(&self) -> HnswConfig
pub fn hnsw_config(&self) -> HnswConfig
Effective global HNSW config: HnswConfig::default unless explicitly set.
Sourcepub fn optimizers(&self) -> EdgeOptimizersConfig
pub fn optimizers(&self) -> EdgeOptimizersConfig
Effective optimizers config: EdgeOptimizersConfig::default unless explicitly set.
Sourcepub fn fill_unspecified_from(self, base: &EdgeConfig) -> Self
pub fn fill_unspecified_from(self, base: &EdgeConfig) -> Self
Fill parameters left unspecified from base, keeping explicitly provided values.
Chained over the fallback layers of EdgeShard::load:
provided → persisted → derived from segments → default.
For tunables, unspecified means None. For vectors and sparse_vectors it means an
empty map: a non-empty map is taken as-is (never merged element-wise) — those define the
stored data, so the load path validates them against existing segments instead of
converging via the optimizers like the tunables do.
Sourcepub fn from_segment_config(segment: &SegmentConfig) -> Self
pub fn from_segment_config(segment: &SegmentConfig) -> Self
Build from existing segment config. Fills all parameters that can be inferred.
Sourcepub fn search_thread_count(&self) -> usize
pub fn search_thread_count(&self) -> usize
Resolve the configured max_search_threads into a concrete
thread count. None derives the count from the number of CPUs, matching the core search
runtime (common::defaults::search_thread_count).
Sourcepub fn check_compatible_with_segment_config(
&self,
other: &SegmentConfig,
) -> Result<(), String>
pub fn check_compatible_with_segment_config( &self, other: &SegmentConfig, ) -> Result<(), String>
Check compatibility with a segment config (e.g. loaded segment).
Sourcepub fn plain_segment_config(&self) -> SegmentConfig
pub fn plain_segment_config(&self) -> SegmentConfig
Segment config for creating appendable segments only. Does not contain any HNSW configuration (plain index only).
Sourcepub fn vector_names(&self) -> HashSet<String>
pub fn vector_names(&self) -> HashSet<String>
All vector names (dense and sparse) currently present in this config.
Must cover both kinds: a segment’s vector_data holds dense and sparse vectors together,
so the optimizer merge consults this set for both.
Sourcepub fn segment_optimizer_config(&self) -> SegmentOptimizerConfig
pub fn segment_optimizer_config(&self) -> SegmentOptimizerConfig
Build segment optimizer config from this config (for blocking optimizers). Use this instead of converting to SegmentConfig first.
Sourcepub fn vector_data_config(&self, name: &String) -> Option<VectorDataConfig>
pub fn vector_data_config(&self, name: &String) -> Option<VectorDataConfig>
Return vector data config for a named vector (for read-only use, e.g. query). Uses plain index; for optimizer/segment creation use segment_optimizer_config or plain_segment_config.
Sourcepub fn get_distance(&self, vector_name: &str) -> OperationResult<Distance>
pub fn get_distance(&self, vector_name: &str) -> OperationResult<Distance>
Distance of a named vector, mirroring CollectionParams::get_distance:
sparse vectors always score with Dot.
pub fn optimizer_thresholds( &self, num_indexing_threads: usize, ) -> OptimizerThresholds
pub fn save(&self, path: &Path) -> OperationResult<()>
pub fn load(path: &Path) -> Option<OperationResult<Self>>
pub fn set_hnsw_config(&mut self, hnsw_config: HnswConfig)
pub fn set_vector_hnsw_config( &mut self, vector_name: &str, hnsw_config: HnswConfig, ) -> OperationResult<()>
pub fn set_optimizers_config(&mut self, optimizers: EdgeOptimizersConfig)
Trait Implementations§
Source§impl Clone for EdgeConfig
impl Clone for EdgeConfig
Source§fn clone(&self) -> EdgeConfig
fn clone(&self) -> EdgeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EdgeConfig
impl Debug for EdgeConfig
Source§impl Default for EdgeConfig
impl Default for EdgeConfig
Source§fn default() -> EdgeConfig
fn default() -> EdgeConfig
Source§impl<'de> Deserialize<'de> for EdgeConfig
impl<'de> Deserialize<'de> for EdgeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EdgeConfig
impl PartialEq for EdgeConfig
Source§impl Serialize for EdgeConfig
impl Serialize for EdgeConfig
impl StructuralPartialEq for EdgeConfig
Auto Trait Implementations§
impl Freeze for EdgeConfig
impl RefUnwindSafe for EdgeConfig
impl Send for EdgeConfig
impl Sync for EdgeConfig
impl Unpin for EdgeConfig
impl UnsafeUnpin for EdgeConfig
impl UnwindSafe for EdgeConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.