pub struct IndexConfig {Show 15 fields
pub num_threads: usize,
pub num_indexing_threads: usize,
pub num_compression_threads: usize,
pub term_cache_blocks: usize,
pub store_cache_blocks: usize,
pub max_indexing_memory_bytes: usize,
pub merge_policy: Box<dyn MergePolicy>,
pub optimization: IndexOptimization,
pub reload_interval_ms: u64,
pub max_concurrent_merges: usize,
pub background_merge_permits: Arc<Semaphore>,
pub merge_bp_time_budget: Option<Duration>,
pub bp_memory_budget_bytes: usize,
pub background_reorder_permits: Arc<Semaphore>,
pub background_reorder_pool: Option<Arc<ThreadPool>>,
}Expand description
Index configuration
Fields§
§num_threads: usizeNumber of threads shared by CPU-intensive search work.
Indexes in the same process that request the same width reuse one Rayon
pool. A value of zero is invalid and is rejected by Index::create and
Index::open.
num_indexing_threads: usizeNumber of parallel segment builders (documents distributed round-robin)
num_compression_threads: usizeNumber of threads for parallel block compression within each segment
term_cache_blocks: usizeBlock cache size for term dictionary per segment
store_cache_blocks: usizeBlock cache size for document store per segment
max_indexing_memory_bytes: usizeMax memory (bytes) across all builders before auto-commit (global limit)
merge_policy: Box<dyn MergePolicy>Merge policy for background segment merging
optimization: IndexOptimizationIndex optimization mode (adaptive, size-optimized, performance-optimized)
reload_interval_ms: u64Reload interval in milliseconds for IndexReader (how often to check for new segments)
max_concurrent_merges: usizeMaximum number of concurrent background merges per index (default: 4)
background_merge_permits: Arc<Semaphore>Application-wide background merge gate shared by clones of this config. The per-index limit alone multiplied large merge working sets by the number of active indexes.
merge_bp_time_budget: Option<Duration>Wall-clock budget for merge-time BP reorder per field (only applies
when the index has reorder_on_merge). A truncated pass still writes
a valid, better-ordered segment; it is marked bp_converged = false
and the background optimizer deepens it later (warm-started).
None = unbudgeted (BP runs to full depth inside the merge, which can
hold a merge slot for 10-30+ minutes on 10M+ doc outputs).
bp_memory_budget_bytes: usizeMemory budget (bytes) for the BP forward index during reorder passes (merge-time and background). When a large segment’s forward index would exceed this, the highest-df dims are dropped from BP’s input (logged loudly) — clustering quality degrades gracefully. Production evidence: 18M-doc merges exceeded the former 2 GB default and dropped ~10% of eligible dims; hosts with less headroom may lower this.
background_reorder_permits: Arc<Semaphore>Hard limit on simultaneous whole-segment BP rewrites. This is shared by all indexes opened from clones of this config and applies to optimizer, merge-time, and manual reorder passes. It is deliberately separate from the Rayon pool width: one pass can already use every background CPU thread and consume the full BP memory budget.
background_reorder_pool: Option<Arc<ThreadPool>>Optional process/application-owned Rayon pool for BP work. Supplying
one lets every index and the optimizer share the same worker threads;
None lazily uses one process-wide cores/2 fallback pool.
Trait Implementations§
Source§impl Clone for IndexConfig
impl Clone for IndexConfig
Source§fn clone(&self) -> IndexConfig
fn clone(&self) -> IndexConfig
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 IndexConfig
impl Debug for IndexConfig
Auto Trait Implementations§
impl !RefUnwindSafe for IndexConfig
impl !UnwindSafe for IndexConfig
impl Freeze for IndexConfig
impl Send for IndexConfig
impl Sync for IndexConfig
impl Unpin for IndexConfig
impl UnsafeUnpin for IndexConfig
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,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<E> ResultError for E
impl<T> ResultType for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.