Skip to content

feat(search): configure search behavior via .conf.yaml#51

Merged
rgonek merged 7 commits intomainfrom
feature/search-config-yaml
Mar 3, 2026
Merged

feat(search): configure search behavior via .conf.yaml#51
rgonek merged 7 commits intomainfrom
feature/search-config-yaml

Conversation

@rgonek
Copy link
Owner

@rgonek rgonek commented Mar 3, 2026

Summary

  • Add .conf.yaml per-repo config file with a search: block for engine, limit, and result_detail
  • Add result_detail presets (full / standard / minimal) to control how many fields are returned per search result — useful for reducing token cost in agent workflows
  • CLI flags always win over config file (same precedence pattern as existing HTTP policy overrides)
  • .conf.yaml added to gitignore template generated by conf init

New config file

search:
  engine: sqlite        # "sqlite" or "bleve" — default: sqlite
  limit: 20             # max results — default: 20
  result_detail: full   # "full" | "standard" | "minimal" — default: full

Result detail presets

Preset Fields kept
full All fields (unchanged behaviour)
standard Path, Title, SpaceKey, Labels, HeadingPath, HeadingText, Line, Snippet, Score
minimal Path, HeadingPath, HeadingText, Line, Snippet

Test Plan

  • go test ./... — all 11 packages pass
  • Create .conf.yaml with result_detail: minimal, run conf search "term" — verify stripped fields
  • Run conf search "term" --limit 50 with limit: 5 in config — verify CLI flag wins (50 results)
  • Delete .conf.yaml — verify defaults still apply
  • Run conf init — verify .conf.yaml appears in generated .gitignore

🤖 Generated with Claude Code

Robert Gonek and others added 7 commits March 3, 2026 11:24
Describes .conf.yaml per-repo config for search engine, limit, and
result_detail presets (full/standard/minimal).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Step-by-step TDD plan for .conf.yaml search settings (engine, limit,
result_detail) with CLI flag precedence and field projection presets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ence

Wire LoadSearchConfig into runSearch so engine, limit, and result_detail
are read from .conf.yaml; CLI flags (--engine, --limit, --result-detail)
take precedence when explicitly provided. Add --result-detail flag and
apply projectResult projection before printing search results.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- searchconfig.go: nolint gosec G304 on os.ReadFile with fixed filename
- status_run_test.go: add return after t.Fatal to silence SA5011 false positive

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rgonek rgonek merged commit a18ca64 into main Mar 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant