Documentation
¶
Overview ¶
Package search provides chunk types, file-to-chunk splitting, and in-memory full-text search with BM25 scoring.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveStrategy ¶
ResolveStrategy picks a strategy when the user provides "" (auto).
Types ¶
type Chunk ¶
type Chunk struct {
// Source is the file path relative to the project root.
Source string
// Section is the heading hierarchy (e.g. "## Ownership > ### Cross-namespace").
Section string
// Title is the heading text or key name.
Title string
// Body is the full text content of the section.
Body string
// Tags are metadata labels (from config or auto-derived).
Tags []string
// ConventionID links this chunk to a convention (empty if from file source).
ConventionID string
// Docs lists documentation paths associated with a convention chunk.
Docs []string
}
Chunk is the atomic unit of searchable content.
func ChunkContent ¶
ChunkContent splits content into chunks using the given strategy. strategy must be "section", "file", or "none".
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is an in-memory search index over chunks. It is safe for concurrent use: Search acquires a read lock, Merge acquires a write lock.
type LiveIndex ¶
type LiveIndex struct {
// contains filtered or unexported fields
}
LiveIndex provides safe atomic access to a swappable Index. Create with NewLiveIndex. Safe for concurrent use; Get and Len can be called freely alongside Swap.
func NewLiveIndex ¶
func NewLiveIndex() *LiveIndex
NewLiveIndex returns a LiveIndex backed by an empty index.
func (*LiveIndex) Len ¶
Len returns the number of indexed chunks, or 0 if the index is empty. Safe for concurrent use.