Documentation
¶
Index ¶
- type Config
- type Engine
- func (e *Engine) Add(vec simd.Vec512, scale float32, id int) error
- func (e *Engine) AddBatch(vectors []simd.Vec512, scales []float32, ids []int) error
- func (e *Engine) Search(query *simd.Vec512, k int) ([]SearchResult, error)
- func (e *Engine) SetTrained(trained bool)
- func (e *Engine) Stats() IndexStats
- func (e *Engine) Train(vectors []simd.Vec512, scales []float32) error
- type IndexStats
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Index type threshold
MaxFlatSize int // Use flat index below this size (default: 50000)
// IVF parameters
NList int // Number of clusters (default: 4096)
NProbe int // Number of clusters to search (default: 8)
// PQ parameters
M int // Number of subquantizers (default: 64)
NBits int // Bits per subquantizer (default: 8)
// HNSW parameters
HNSWEnabled bool // Use HNSW for centroid routing (default: true)
HNSWM int // HNSW connections (default: 16)
HNSWEfC int // HNSW construction parameter (default: 200)
// Search parameters
RerankSize int // Number of candidates to rerank (default: 128)
UseParallel bool // Use parallel search (default: true)
}
Config holds engine configuration
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine is the main search engine combining IVF-HNSW-PQ with reranking
func (*Engine) SetTrained ¶
SetTrained sets the trained flag (used when loading from cache)
type IndexStats ¶
type IndexStats struct {
Size int
IndexType string
MemoryUsage int64
NLists int
ListSizes []int
PQEnabled bool
PQM int
PQBits int
HNSWEnabled bool
}
IndexStats contains index statistics
type SearchResult ¶
SearchResult represents a search result
Click to show internal directories.
Click to hide internal directories.