searchsvc

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

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

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

Variables

This section is empty.

Functions

func NormalizeSearchType

func NormalizeSearchType(searchType string) (string, error)

NormalizeSearchType validates and normalizes a search type string.

Types

type EIPMetadataProvider added in v0.12.0

type EIPMetadataProvider interface {
	Statuses() []string
	Categories() []string
	Types() []string
}

EIPMetadataProvider provides filter metadata for EIP search.

type EIPSearcher added in v0.12.0

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

EIPSearcher provides semantic search over EIPs.

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 SearchAllResponse added in v0.18.0

type SearchAllResponse struct {
	Type     string                  `json:"type"`
	Query    string                  `json:"query"`
	Examples *SearchExamplesResponse `json:"examples,omitempty"`
	Runbooks *SearchRunbooksResponse `json:"runbooks,omitempty"`
	EIPs     *SearchEIPsResponse     `json:"eips,omitempty"`
}

SearchAllResponse is the response for searching across all types.

type SearchEIPResult added in v0.12.0

type SearchEIPResult struct {
	Number          int     `json:"number"`
	Title           string  `json:"title"`
	Description     string  `json:"description"`
	Author          string  `json:"author,omitempty"`
	Status          string  `json:"status"`
	Type            string  `json:"type"`
	Category        string  `json:"category,omitempty"`
	Created         string  `json:"created,omitempty"`
	URL             string  `json:"url"`
	SimilarityScore float64 `json:"similarity_score"`
}

SearchEIPResult represents a single EIP search result.

type SearchEIPsResponse added in v0.12.0

type SearchEIPsResponse struct {
	Type                string             `json:"type"`
	Query               string             `json:"query"`
	StatusFilter        string             `json:"status_filter,omitempty"`
	CategoryFilter      string             `json:"category_filter,omitempty"`
	TypeFilter          string             `json:"type_filter,omitempty"`
	TotalMatches        int                `json:"total_matches"`
	Results             []*SearchEIPResult `json:"results"`
	AvailableStatuses   []string           `json:"available_statuses"`
	AvailableCategories []string           `json:"available_categories"`
	AvailableTypes      []string           `json:"available_types"`
}

SearchEIPsResponse is the response for EIP search.

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
}

Service provides search across examples, runbooks, and EIPs.

func New

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

New creates a new search service.

func (*Service) SearchAll added in v0.18.0

func (s *Service) SearchAll(query string, limit int) (*SearchAllResponse, error)

SearchAll searches across all available indices and merges results.

func (*Service) SearchEIPs added in v0.12.0

func (s *Service) SearchEIPs(
	query, statusFilter, categoryFilter, typeFilter string,
	limit int,
) (*SearchEIPsResponse, error)

SearchEIPs searches EIPs with optional status, category, and type filters.

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