Configuration

EdgeConfig describes the vectors an Edge Shard stores and the parameters that govern how it indexes, stores, and searches them. Pass it to create/new when starting a new shard, and optionally to load when reopening one.

Every parameter except vectors and sparse_vectors is optional. A parameter left unset is considered as not specified rather than set to the default: when loading an existing shard, each unspecified parameter resolves through provided - persisted in edge_config.json - derived from the existing segments - default, so it keeps whatever the shard already has. This is why a configuration that sets only wal_options leaves the rest of the shard’s configuration untouched.

EdgeConfig

EdgeConfig(
    vectors: Optional[Union[EdgeVectorParams, Dict[str, EdgeVectorParams]]] = None,
    sparse_vectors: Optional[Dict[str, EdgeSparseVectorParams]] = None,
    on_disk_payload: Optional[bool] = None,
    hnsw_config: Optional[HnswIndexConfig] = None,
    quantization_config: Optional[QuantizationConfigType] = None,
    optimizers: Optional[EdgeOptimizersConfig] = None,
    max_search_threads: Optional[int] = None,
    search_pool_core: Optional[int] = None,
)

In Rust, EdgeConfig is a struct whose fields you can set directly, or build with the fluent EdgeConfig::builder():

let config = EdgeConfig::builder()
    .vector("text", EdgeVectorParams::builder(384, Distance::Cosine).build())
    .on_disk_payload(true)
    .build();
ParameterDescription
vectorsDense vector configuration. In Python, a single EdgeVectorParams configures the default unnamed vector. Optional if sparse_vectors is given.
sparse_vectorsSparse vector configuration.
on_disk_payloadWhether to cache payloads in RAM for faster access, or serve them from disk.
hnsw_configGlobal HNSW parameters, used when building the HNSW index. Override per vector with EdgeVectorParams.hnsw_config.
quantization_configGlobal quantization. Override per vector with EdgeVectorParams.quantization_config. Refer to Quantization.
optimizersOptimizer parameters. Refer to Optimizer Parameters.
max_search_threadsSize of the shard’s search thread pool, which runs per-segment reads in parallel. Defaults to a count derived from the number of CPUs.
search_pool_corePin every search pool thread to this CPU core, bounding the shard’s search compute to one core while keeping the pool’s I/O overlap. Best-effort. Defaults to OS scheduling.
wal_optionsA WalOptions value carrying the write-ahead log parameters. Rust only. Refer to WAL Options.

A new shard must define at least one of vectors or sparse_vectors; both are validated against the existing segments on load. Python raises ValueError if both are empty, so changing only a tunable parameter still requires redeclaring the vectors. Rust accepts a tunables-only configuration and takes the vectors from the shard.

Dense Vector Parameters

EdgeVectorParams configures one named dense vector. size and distance are required and cannot be changed after the shard is created.

EdgeVectorParams(
    size: int,
    distance: Distance,
    on_disk: Optional[bool] = None,
    multivector_config: Optional[MultiVectorConfig] = None,
    datatype: Optional[VectorStorageDatatype] = None,
    quantization_config: Optional[QuantizationConfigType] = None,
    hnsw_config: Optional[HnswIndexConfig] = None,
)
pub fn builder(size: usize, distance: Distance) -> EdgeVectorParamsBuilder
ParameterDescription
sizeVector dimension. Required.
distanceDistance metric. Required.
on_diskWhether to cache vectors in RAM for faster access, or serve them from disk.
multivector_configMulti-vector configuration, for late-interaction models.
datatypeStorage datatype for the vector.
quantization_configPer-vector quantization, overriding the global setting.
hnsw_configPer-vector HNSW parameters, overriding the global setting.

Sparse Vector Parameters

EdgeSparseVectorParams configures one named sparse vector. All parameters are optional.

EdgeSparseVectorParams(
    full_scan_threshold: Optional[int] = None,
    on_disk: Optional[bool] = None,
    modifier: Optional[Modifier] = None,
    datatype: Optional[VectorStorageDatatype] = None,
)
pub fn builder() -> EdgeSparseVectorParamsBuilder
ParameterDescription
full_scan_thresholdThreshold below which a full scan is used instead of the sparse index.
on_diskWhether to cache sparse vector indexes in RAM for faster access, or serve them from disk.
modifierScore modifier. Set to Modifier.Idf for BM25 scoring. Refer to BM25 with Qdrant Edge.
datatypeStorage datatype for the vector.

Optimizer Parameters

EdgeOptimizersConfig controls what the optimize method does when you call it.

EdgeOptimizersConfig(
    deleted_threshold: Optional[float] = None,
    vacuum_min_vector_number: Optional[int] = None,
    default_segment_number: Optional[int] = None,
    max_segment_size: Optional[int] = None,
    indexing_threshold: Optional[int] = None,
    prevent_unoptimized: Optional[bool] = None,
)

In Rust, set the fields you need and leave the rest at their defaults:

pub struct EdgeOptimizersConfig {
    pub deleted_threshold: Option<f64>,
    pub vacuum_min_vector_number: Option<usize>,
    pub default_segment_number: Option<usize>,
    pub max_segment_size: Option<usize>,
    pub indexing_threshold: Option<usize>,
    pub prevent_unoptimized: Option<bool>,
}
let optimizers = EdgeOptimizersConfig {
    indexing_threshold: Some(20_000),
    ..Default::default()
};
ParameterDescription
deleted_thresholdMinimum fraction of deleted vectors in a segment required to run vacuum. Default: 0.2.
vacuum_min_vector_numberMinimum number of vectors in a segment required to run vacuum. Default: 1000.
default_segment_numberTarget number of segments. 0 chooses automatically from the CPU count.
max_segment_sizeMaximum segment size in KB. Derived from the CPU count when unset.
indexing_thresholdSize in KB above which a segment gets an HNSW index.
prevent_unoptimizedPrevents slow reads from large unoptimized segments by deferring the visibility of points until they’ve been indexed.

optimize

Applies the optimizer parameters above: removes data marked for deletion, merges segments, and builds indexes. Qdrant Edge has no background optimizer, so optimization happens only when you call this method. It runs synchronously and blocks until no further optimization is planned.

def optimize(self) -> bool
pub fn optimize(&self) -> OperationResult<bool>

Returns True if any segment was optimized, and False if the shard was already optimal.

Call optimize at a point when blocking is acceptable, such as after a batch of upserts or during an idle period. Until it runs, newly written vectors are searchable but not yet indexed, which shows up as an indexed_vectors_count below points_count in info.

WAL Options

Rust only

Qdrant Edge records every update in a write-ahead log before applying it to storage. WalOptions is available in Rust only, and is set through EdgeConfig.wal_options.

pub struct WalOptions {
    pub segment_capacity: usize,
    pub segment_queue_len: usize,
    pub retain_closed: NonZeroUsize,
}
ParameterDescription
segment_capacityWAL segment capacity in bytes. Default: 32 MiB.
segment_queue_lenNumber of segments to pre-create so appends never wait on segment creation. Default: 0.
retain_closedNumber of closed WAL files to retain. Default: 1.

The WAL file is pre-allocated to segment_capacity, which inflates backup sizes and OS storage reports. Reduce it for embedded and mobile deployments where 32 MiB is too large. Refer to Custom WAL Size.

Change Configuration on a Live Shard

Update a shard’s configuration after it has been opened and persist the change to edge_config.json. Rust only.

pub fn set_hnsw_config(&self, hnsw_config: HnswConfig) -> OperationResult<()>
pub fn set_vector_hnsw_config(&self, vector_name: &str, hnsw_config: HnswConfig) -> OperationResult<()>
pub fn set_optimizers_config(&self, optimizers: EdgeOptimizersConfig) -> OperationResult<()>
MethodDescription
set_hnsw_configSets the global HNSW config. Does not affect per-vector overrides.
set_vector_hnsw_configSets the HNSW config for one named vector. Fails if the vector does not exist.
set_optimizers_configSets the optimizer parameters.

Changes apply to work done after the call. Existing segments converge to the new parameters as the optimizers run.

Was this page useful?

Thank you for your feedback! 🙏

We are sorry to hear that. 😔 You can edit this page on GitHub, or create a GitHub issue.