indexer

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

type Embedder struct {
	// contains filtered or unexported fields
}

Embedder generates and atomically stores embeddings for chunks whose vector/metadata pair is missing, stale, or invalid.

func NewEmbedder

func NewEmbedder(database *db.DB, provider providers.EmbeddingProvider, providerTag, fingerprint string) *Embedder

func (*Embedder) EmbedCollection

func (e *Embedder) EmbedCollection(ctx context.Context, collection string) error

EmbedCollection repairs every chunk that does not have a valid vector and matching current metadata.

type Indexer

type Indexer struct {

	// Force reparses files whose content is unchanged. Change detection is by
	// content hash, so a parser or chunker fix is otherwise invisible to
	// everything already indexed.
	Force bool
	// contains filtered or unexported fields
}

Indexer walks a collection and upserts documents into the DB.

func New

func New(database *db.DB, chunkSize int) *Indexer

func (*Indexer) Index

func (idx *Indexer) Index(ctx context.Context, col config.Collection) (Stats, error)

Index indexes all files in a collection.

type Stats

type Stats struct {
	FilesScanned int
	FilesAdded   int
	FilesUpdated int
	FilesRemoved int
	FilesSkipped int
	Duration     time.Duration
}

Stats summarises an index run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL