Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleSearchAPI ¶
func HandleSearchAPI(searcher *FederatedSearch) forge.Handler
HandleSearchAPI returns a handler that serves search results as JSON. GET {base}/api/search?q=...&limit=20
Types ¶
type FederatedSearch ¶
type FederatedSearch struct {
// contains filtered or unexported fields
}
FederatedSearch fans out search queries across all SearchableContributor instances and the local content index, then merges and ranks results.
func NewFederatedSearch ¶
func NewFederatedSearch( registry *contributor.ContributorRegistry, basePath string, logger forge.Logger, ) *FederatedSearch
NewFederatedSearch creates a new federated search engine.
func (*FederatedSearch) Index ¶
func (fs *FederatedSearch) Index() *Index
Index returns the local search index for direct access.
func (*FederatedSearch) RebuildIndex ¶
func (fs *FederatedSearch) RebuildIndex()
RebuildIndex rebuilds the local search index from the registry.
func (*FederatedSearch) Search ¶
func (fs *FederatedSearch) Search(ctx context.Context, query string, limit int) []contributor.SearchResult
Search performs a federated search across all providers.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index provides fast in-memory search over local dashboard content.
func (*Index) Rebuild ¶
func (idx *Index) Rebuild(registry *contributor.ContributorRegistry, basePath string)
Rebuild rebuilds the index from the registry's current state.
func (*Index) Search ¶
func (idx *Index) Search(query string, limit int) []contributor.SearchResult
Search performs a simple substring match against indexed entries.
type IndexEntry ¶
type IndexEntry struct {
Title string `json:"title"`
Description string `json:"description"`
URL string `json:"url"`
Icon string `json:"icon"`
Source string `json:"source"`
Category string `json:"category"` // "page", "widget", "setting"
}
IndexEntry represents a searchable item in the local index.