indexquery

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package indexquery builds retrieval candidates from the SQLite index.

Index

Constants

View Source
const TokenCounterName = "approx_chars_div_4"

Variables

This section is empty.

Functions

func ApproximateTokenCount

func ApproximateTokenCount(text string) int

func ArtifactCandidate

func ArtifactCandidate(art store.ArtifactRow, sources []store.SourceRow, todos []store.TodoRow, body, extractedJSON string) retrieval.Candidate
func ArtifactCandidateWithLinks(art store.ArtifactRow, sources []store.SourceRow, links []store.LinkRow, todos []store.TodoRow, sections []store.SectionRow, body, extractedJSON string) retrieval.Candidate

func LoadCandidates

func LoadCandidates(db *store.DB, fp store.FilterParams) ([]retrieval.Candidate, error)

func LoadCandidatesByArtifactIDs

func LoadCandidatesByArtifactIDs(db *store.DB, fp store.FilterParams, ids []string) ([]retrieval.Candidate, error)

func LoadCandidatesForQuery

func LoadCandidatesForQuery(db *store.DB, fp store.FilterParams, query string) ([]retrieval.Candidate, error)

func RenderCandidateBody

func RenderCandidateBody(art store.ArtifactRow, sources []store.SourceRow, todos []store.TodoRow, body string) string

Types

type CandidateLoadReport

type CandidateLoadReport struct {
	RuntimeMode                  string
	EffectiveMode                string
	FullArtifactCount            int
	PreselectedCount             int
	HydratedCount                int
	SourceManifestMode           string
	SourceManifestCount          int
	SourceManifestMS             int64
	SourceManifestFallbackReason string
	FallbackReason               string
	LaneCounts                   map[string]int
	PreselectMS                  int64
	HydrateMS                    int64
	FullLoadMS                   int64
	OptimizedError               string
}

type CandidateLoadResult

type CandidateLoadResult struct {
	Candidates []retrieval.Candidate
	Report     CandidateLoadReport
}

func LoadCandidatesForQueryOptimized

func LoadCandidatesForQueryOptimized(db *store.DB, fp store.FilterParams, query string, mode RuntimeMode) (CandidateLoadResult, error)

func LoadCandidatesForQueryWithRuntime

func LoadCandidatesForQueryWithRuntime(db *store.DB, fp store.FilterParams, query string, mode RuntimeMode) (CandidateLoadResult, error)

type PreselectOptions

type PreselectOptions struct {
	PreselectLimit              int
	MaxRepoSizeForFullHydration int
	FallbackFullHydrationBelow  int
}

func DefaultPreselectOptions

func DefaultPreselectOptions() PreselectOptions

type PreselectReport

type PreselectReport struct {
	FullArtifactCount int
	SelectedCount     int
	LaneCounts        map[string]int
	FallbackReason    string
}

func PreselectArtifactIDsForQuery

func PreselectArtifactIDsForQuery(db *store.DB, fp store.FilterParams, query string, opts PreselectOptions) ([]string, PreselectReport, error)

type RuntimeMode

type RuntimeMode string
const (
	RuntimeModeFull            RuntimeMode = "full"
	RuntimeModePreselectShadow RuntimeMode = "preselect_shadow"
	RuntimeModePreselectActive RuntimeMode = "preselect_active"
)

func DefaultRuntimeMode

func DefaultRuntimeMode() RuntimeMode

func ParseRuntimeMode

func ParseRuntimeMode(value string) (RuntimeMode, error)

type SourceManifestCandidateMode added in v1.0.0

type SourceManifestCandidateMode string
const (
	SourceManifestCandidateModeOff      SourceManifestCandidateMode = "off"
	SourceManifestCandidateModeMetadata SourceManifestCandidateMode = "metadata"
	SourceManifestCandidateModeWindow   SourceManifestCandidateMode = "window"
)

func ParseSourceManifestCandidateMode added in v1.0.0

func ParseSourceManifestCandidateMode(value string) (SourceManifestCandidateMode, error)

type SourceManifestCandidateOptions added in v1.0.0

type SourceManifestCandidateOptions struct {
	Mode        SourceManifestCandidateMode
	Limit       int
	WindowBytes int
}

func DefaultSourceManifestCandidateOptions added in v1.0.0

func DefaultSourceManifestCandidateOptions() SourceManifestCandidateOptions

type SourceManifestCandidateReport added in v1.0.0

type SourceManifestCandidateReport struct {
	Mode           string
	Match          string
	SelectedCount  int
	FallbackReason string
}

func LoadSourceManifestCandidatesForQuery added in v1.0.0

func LoadSourceManifestCandidatesForQuery(db *store.DB, fp store.FilterParams, query string, opts SourceManifestCandidateOptions) ([]retrieval.Candidate, SourceManifestCandidateReport, error)

Jump to

Keyboard shortcuts

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