docsearch

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocChunk

type DocChunk struct {
	ID      string // e.g., "workflows/session-start"
	Topic   string // e.g., "workflows"
	Heading string // e.g., "Session Start Checklist"
	Content string // full text for indexing
	Preview string // first ~200 chars for display
}

DocChunk represents a searchable section of documentation.

func ChunkAllDocs

func ChunkAllDocs() []DocChunk

ChunkAllDocs splits all embedded documentation into searchable chunks.

func ChunkMarkdown

func ChunkMarkdown(topic, content string) []DocChunk

ChunkMarkdown splits a markdown document into chunks by headers.

type SearchResult

type SearchResult struct {
	Chunk DocChunk
	Score float64
}

SearchResult represents a search hit with score.

type Searcher

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

Searcher provides full-text search over documentation.

func NewSearcher

func NewSearcher(chunks []DocChunk) (*Searcher, error)

NewSearcher creates a new searcher with an in-memory Bleve index.

func (*Searcher) Close

func (s *Searcher) Close() error

Close releases resources held by the searcher.

func (*Searcher) Search

func (s *Searcher) Search(queryStr string, limit int, exact bool) ([]SearchResult, error)

Search performs a search with optional fuzzy matching. When exact is false, fuzzy matching is enabled for typo tolerance.

Jump to

Keyboard shortcuts

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