Documentation
¶
Index ¶
- func WriteAskResult(w io.Writer, answer string, results []search.Result, ...) error
- func WriteAskSources(w io.Writer, sources []AskSource) error
- func WriteAskSourcesMarkdown(w io.Writer, sources []AskSource) error
- type AskOutput
- type AskSource
- type Formatter
- type JSONFormatter
- type MarkdownFormatter
- type TextFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteAskResult ¶ added in v0.8.0
func WriteAskResult(w io.Writer, answer string, results []search.Result, collections []config.Collection, format string) error
WriteAskResult writes a generated answer and compact, deduplicated sources.
func WriteAskSources ¶ added in v0.8.0
WriteAskSources writes compact source rows.
Types ¶
type AskSource ¶ added in v0.8.0
type AskSource struct {
Index int `json:"index"`
Indices []int `json:"indices"`
Title string `json:"title"`
Path string `json:"path"`
Collection string `json:"collection"`
RelativePath string `json:"relative_path"`
}
AskSource is a compact source reference for generated answers.
func CompactAskSources ¶ added in v0.8.0
func CompactAskSources(results []search.Result, collections []config.Collection) []AskSource
CompactAskSources converts chunk-level search hits into document-level source rows.
type JSONFormatter ¶
type JSONFormatter struct{}
JSONFormatter writes results as a JSON array.
func (*JSONFormatter) WriteResults ¶
type MarkdownFormatter ¶
type MarkdownFormatter struct{}
MarkdownFormatter writes results as a Markdown list.
func (*MarkdownFormatter) WriteResults ¶
type TextFormatter ¶
type TextFormatter struct{}
TextFormatter writes human-readable results.
func (*TextFormatter) WriteResults ¶
Click to show internal directories.
Click to hide internal directories.