Skip to main content

Module searchable

Module searchable 

Source
Expand description

Engine-agnostic searchable-index trait.

Both HybridIndex (transformer engines) and RipvecIndex (the cacheless ripvec engine) expose the same operational surface to downstream consumers: a slice of chunks, the embedding row for a chunk by index, and a search method that returns (chunk_idx, score) pairs ranked descending.

Naming the surface as a trait lets LSP / MCP code (navigation, symbols, hover, references, calls) take &dyn SearchableIndex instead of &HybridIndex and work transparently across engines. Without it, every engine swap requires touching every LSP module.

Traitsยง

SearchableIndex
Engine-agnostic searchable index.