Documentation
¶
Overview ¶
Package config defines indexer configuration: repo root discovery, index storage paths, default field boosts, and ignore-file location.
Index ¶
Constants ¶
const ( IndexDirName = ".codesearch" IndexSubdir = "index" MetaFileName = "meta.json" )
Index storage layout, relative to the repo root.
const DefaultMaxFileSize int64 = 1 * 1024 * 1024 // 1 MiB
DefaultMaxFileSize caps the per-file size accepted by the walker.
Variables ¶
var DefaultBoosts = map[string]float64{
"title": 5.0,
"tags": 2.0,
"body": 1.0,
"description": 3.0,
"keywords": 4.0,
}
DefaultBoosts are the query-time field boosts applied when an indexed field is present. SEO-base names (description, keywords) are listed here because they're the conventions used in this repo, but they're only applied when present so the indexer remains generic.
Functions ¶
Types ¶
type IndexConfig ¶
IndexConfig captures the runtime knobs shared across the codesearch subcommands.
func Load ¶
func Load(start string) (*IndexConfig, error)
Load discovers the repo root from start (or cwd when empty) and returns the config with defaults applied.
func (*IndexConfig) IndexDir ¶
func (c *IndexConfig) IndexDir() string
IndexDir is the directory where the Bleve index and metadata live.
func (*IndexConfig) IndexPath ¶
func (c *IndexConfig) IndexPath() string
IndexPath is the Bleve index location inside IndexDir.
func (*IndexConfig) MetaPath ¶
func (c *IndexConfig) MetaPath() string
MetaPath is the JSON sidecar location inside IndexDir.