frankensearch-storage
FrankenSQLite-backed metadata and embedding job storage for frankensearch.
Overview
This crate owns the persistent storage layer for frankensearch, backed by FrankenSQLite. It manages schema bootstrapping, document metadata persistence, content-hash deduplication, an embedding job queue, search history, bookmarks, index build metadata, and staleness detection. It serves as the bridge between frankensearch's in-memory search pipeline and durable on-disk state.
Key Types
Storage and Connection
Storage- main storage handle wrapping a FrankenSQLite connectionStorageConfig- configuration for storage initialization
Document Management
DocumentRecord- stored document metadata recordupsert_document- insert or update a document with deduplist_document_ids/count_documents- document enumeration and countingEmbeddingStatus/StatusCounts- per-document embedding state tracking
Content Hashing and Deduplication
ContentHasher- SHA-256 content hashing for change detectionDeduplicationDecision- whether to re-embed or skip a documentlookup_content_hash/record_content_hash- hash lookup and persistence
Job Queue
PersistentJobQueue- durable embedding job queue with claim/complete/fail lifecycleClaimedJob/EnqueueRequest- job queue request and claim typesJobQueueConfig/JobQueueMetrics- queue configuration and telemetryQueueDepth- current queue depth by status
Pipeline
StorageBackedJobRunner- orchestrates document ingestion through the embedding pipelineIngestRequest/IngestResult/IngestAction- ingestion request/result typesPipelineConfig/PipelineMetrics- pipeline configuration and performance metricsEmbeddingVectorSink/InMemoryVectorSink- sinks for produced embedding vectors
History and Bookmarks
record_search/list_search_history- search history recording and retrievaladd_bookmark/list_bookmarks/is_bookmarked- document bookmarking
Index Metadata and Staleness
IndexMetadata/IndexBuildRecord- index build trackingStalenessCheck/StalenessReport- index freshness detectionStorageBackedStaleness- staleness checking backed by stored metadata
Schema
bootstrap- creates/migrates the storage schemaSCHEMA_VERSION/current_version- schema versioning
Features
| Feature | Description |
|---|---|
fts5 |
Enables Fts5LexicalSearch adapter using FrankenSQLite FTS5 |
Usage
use ;
// Open or create a storage database
let config = default;
let storage = open
.expect;
// Bootstrap schema
bootstrap.expect;
// Upsert a document
// upsert_document(&storage, &doc).expect("upsert");
Dependency Graph Position
frankensearch-core
^
|
frankensearch-storage
^
|-- frankensearch-fsfs
|-- frankensearch (root, optional, feature: storage)
License
MIT