Documentation
¶
Overview ¶
Package search ranks bounded records from the canonical SQLite index.
Index ¶
Constants ¶
View Source
const ( MatchText = "text" MatchFixed = "fixed" MatchRegexp = "regexp" )
View Source
const ( MaxResults = 100 MaxQueryBytes = 16 * 1024 MaxQueryTerms = 256 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type FilesystemOptions ¶ added in v0.4.0
type FilesystemOptions struct {
Limit int
Scope string
IgnoreGlobs []string
MaxFileBytes int64
RequestedMode string
MatchKind string
About string
}
FilesystemOptions bounds the live lexical fallback used while the durable index is being replaced. It deliberately has no semantic or graph inputs.
type LexicalQuery ¶ added in v0.4.0
type QueryPlan ¶ added in v0.4.0
type QueryPlan struct {
Lexical LexicalQuery `json:"lexical"`
Semantic *SemanticQuery `json:"semantic,omitempty"`
Scope string `json:"scope,omitempty"`
// contains filtered or unexported fields
}
type RankedRecord ¶
type RankedRecord struct {
Path string `json:"path"`
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
Kind string `json:"kind,omitempty"`
Title string `json:"title,omitempty"`
Excerpt string `json:"excerpt"`
Metadata map[string]any `json:"metadata,omitempty"`
Source string `json:"source,omitempty"`
Retrieval []string `json:"-"`
Score float64 `json:"-"`
// contains filtered or unexported fields
}
func (RankedRecord) MarshalJSON ¶ added in v0.3.0
func (r RankedRecord) MarshalJSON() ([]byte, error)
type Result ¶
type Result struct {
Schema string `json:"schema"`
Query string `json:"query"`
RequestedMode string `json:"requestedMode"`
ActiveMode string `json:"activeMode"`
FallbackReason string `json:"fallbackReason,omitempty"`
ElapsedMS int64 `json:"elapsedMs"`
QueryPlan QueryPlan `json:"queryPlan"`
Records []RankedRecord `json:"records"`
MorePaths []string `json:"morePaths,omitempty"`
}
func RunFilesystem ¶ added in v0.4.0
func RunFilesystem( ctx context.Context, root, query string, opts FilesystemOptions, ) (Result, error)
RunFilesystem searches current working-tree files without consulting the SQLite index. This keeps default search available during an index run without returning records that were deleted or changed after the last commit.
type SemanticQuery ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.