Documentation
¶
Overview ¶
Package indexquery builds retrieval candidates from the SQLite index.
Index ¶
- Constants
- func ApproximateTokenCount(text string) int
- func ArtifactCandidate(art store.ArtifactRow, sources []store.SourceRow, todos []store.TodoRow, ...) retrieval.Candidate
- func ArtifactCandidateWithLinks(art store.ArtifactRow, sources []store.SourceRow, links []store.LinkRow, ...) retrieval.Candidate
- func LoadCandidates(db *store.DB, fp store.FilterParams) ([]retrieval.Candidate, error)
- func LoadCandidatesByArtifactIDs(db *store.DB, fp store.FilterParams, ids []string) ([]retrieval.Candidate, error)
- func LoadCandidatesForQuery(db *store.DB, fp store.FilterParams, query string) ([]retrieval.Candidate, error)
- func RenderCandidateBody(art store.ArtifactRow, sources []store.SourceRow, todos []store.TodoRow, ...) string
- type CandidateLoadReport
- type CandidateLoadResult
- type PreselectOptions
- type PreselectReport
- type RuntimeMode
- type SourceManifestCandidateMode
- type SourceManifestCandidateOptions
- type SourceManifestCandidateReport
Constants ¶
View Source
const TokenCounterName = "approx_chars_div_4"
Variables ¶
This section is empty.
Functions ¶
func ApproximateTokenCount ¶
func ArtifactCandidate ¶
func LoadCandidates ¶
func LoadCandidatesForQuery ¶
func RenderCandidateBody ¶
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)
Click to show internal directories.
Click to hide internal directories.