Skip to main content

IndexConfig

Struct IndexConfig 

Source
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: usize

Number 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: usize

Number of parallel segment builders (documents distributed round-robin)

§num_compression_threads: usize

Number of threads for parallel block compression within each segment

§term_cache_blocks: usize

Block cache size for term dictionary per segment

§store_cache_blocks: usize

Block cache size for document store per segment

§max_indexing_memory_bytes: usize

Max memory (bytes) across all builders before auto-commit (global limit)

§merge_policy: Box<dyn MergePolicy>

Merge policy for background segment merging

§optimization: IndexOptimization

Index optimization mode (adaptive, size-optimized, performance-optimized)

§reload_interval_ms: u64

Reload interval in milliseconds for IndexReader (how often to check for new segments)

§max_concurrent_merges: usize

Maximum 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: usize

Memory 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

Source§

fn clone(&self) -> IndexConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IndexConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IndexConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<E> ResultError for E
where E: Send + Debug + Sync,

Source§

impl<T> ResultType for T
where T: Send + Clone + Sync + Debug,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more