searchsvc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SearchTypeExamples  = "examples"
	SearchTypeRunbooks  = "runbooks"
	SearchTypeNotebooks = "notebooks"

	DefaultSearchLimit    = 3
	MaxExampleSearchLimit = 10
	MaxRunbookSearchLimit = 5
	MinExampleScore       = 0.3
	MinRunbookScore       = 0.25
)

Variables

This section is empty.

Functions

func NormalizeSearchType

func NormalizeSearchType(searchType string) (string, error)

Types

type ExampleSearcher

type ExampleSearcher interface {
	Search(query string, limit int) ([]resource.SearchResult, error)
}

type RunbookSearcher

type RunbookSearcher interface {
	Search(query string, limit int) ([]resource.RunbookSearchResult, error)
}

type RunbookTagProvider

type RunbookTagProvider interface {
	Tags() []string
}

type SearchExampleResult

type SearchExampleResult struct {
	CategoryKey     string  `json:"category_key"`
	CategoryName    string  `json:"category_name"`
	ExampleName     string  `json:"example_name"`
	Description     string  `json:"description"`
	Query           string  `json:"query"`
	TargetCluster   string  `json:"target_cluster"`
	SimilarityScore float64 `json:"similarity_score"`
}

type SearchExamplesResponse

type SearchExamplesResponse struct {
	Type                string                 `json:"type"`
	Query               string                 `json:"query"`
	CategoryFilter      string                 `json:"category_filter,omitempty"`
	TotalMatches        int                    `json:"total_matches"`
	Results             []*SearchExampleResult `json:"results"`
	AvailableCategories []string               `json:"available_categories"`
}

type SearchRunbookResult

type SearchRunbookResult struct {
	Name            string   `json:"name"`
	Description     string   `json:"description"`
	Tags            []string `json:"tags"`
	Prerequisites   []string `json:"prerequisites"`
	Content         string   `json:"content"`
	FilePath        string   `json:"file_path"`
	SimilarityScore float64  `json:"similarity_score"`
}

type SearchRunbooksResponse

type SearchRunbooksResponse struct {
	Type          string                 `json:"type"`
	Query         string                 `json:"query"`
	TagFilter     string                 `json:"tag_filter,omitempty"`
	TotalMatches  int                    `json:"total_matches"`
	Results       []*SearchRunbookResult `json:"results"`
	AvailableTags []string               `json:"available_tags"`
}

type Service

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

func New

func New(
	exampleIndex ExampleSearcher,
	moduleReg *module.Registry,
	runbookIndex RunbookSearcher,
	runbookReg RunbookTagProvider,
) *Service

func (*Service) SearchExamples

func (s *Service) SearchExamples(query, categoryFilter string, limit int) (*SearchExamplesResponse, error)

func (*Service) SearchRunbooks

func (s *Service) SearchRunbooks(query, tagFilter string, limit int) (*SearchRunbooksResponse, error)

Jump to

Keyboard shortcuts

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