Documentation
¶
Index ¶
- Constants
- func NormalizeSearchType(searchType string) (string, error)
- type EIPMetadataProvider
- type EIPSearcher
- type ExampleSearcher
- type RunbookSearcher
- type RunbookTagProvider
- type SearchAllResponse
- type SearchEIPResult
- type SearchEIPsResponse
- type SearchExampleResult
- type SearchExamplesResponse
- type SearchRunbookResult
- type SearchRunbooksResponse
- type Service
- func (s *Service) SearchAll(query string, limit int) (*SearchAllResponse, error)
- func (s *Service) SearchEIPs(query, statusFilter, categoryFilter, typeFilter string, limit int) (*SearchEIPsResponse, error)
- func (s *Service) SearchExamples(query, categoryFilter string, limit int) (*SearchExamplesResponse, error)
- func (s *Service) SearchRunbooks(query, tagFilter string, limit int) (*SearchRunbooksResponse, error)
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 ¶
NormalizeSearchType validates and normalizes a search type string.
Types ¶
type EIPMetadataProvider ¶ added in v0.12.0
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 SearchRunbookResult ¶
type SearchRunbooksResponse ¶
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)
Click to show internal directories.
Click to hide internal directories.