search

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(cfg config.SearchConfig) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

Close closes the Bleve index.

func (*Client) DeleteSkill

func (c *Client) DeleteSkill(ctx context.Context, id string) error

DeleteSkill removes a skill from the search index.

func (*Client) EnsureIndex

func (c *Client) EnsureIndex(ctx context.Context) error

EnsureIndex is a no-op for Bleve (index is created on New).

func (*Client) Healthy

func (c *Client) Healthy(ctx context.Context) bool

Healthy always returns true for the embedded Bleve index.

func (*Client) IndexSkill

func (c *Client) IndexSkill(ctx context.Context, doc *SkillDocument) error

IndexSkill adds or updates a skill in the search index.

func (*Client) Search

func (c *Client) Search(ctx context.Context, query string, limit, offset int, sort []string, filters string) (*SearchResult, error)

Search performs a full-text search with optional sorting and filtering.

type SearchResult

type SearchResult struct {
	Hits             []map[string]interface{} `json:"hits"`
	Query            string                   `json:"query"`
	ProcessingTimeMs int64                    `json:"processingTimeMs"`
	EstimatedTotal   int64                    `json:"estimatedTotalHits"`
}

type SkillDocument

type SkillDocument struct {
	ID               string   `json:"id"`
	Slug             string   `json:"slug"`
	DisplayName      string   `json:"displayName"`
	Summary          string   `json:"summary"`
	SkillMdContent   string   `json:"skillMdContent"`
	Tags             []string `json:"tags"`
	OwnerHandle      string   `json:"ownerHandle"`
	OwnerHandleExact string   `json:"ownerHandleExact"`
	ModerationStatus string   `json:"moderationStatus"`
	IsSuspicious     bool     `json:"isSuspicious"`
	IsDeleted        bool     `json:"isDeleted"`
	Downloads        int64    `json:"downloads"`
	Stars            int      `json:"stars"`
	UpdatedAt        int64    `json:"updatedAt"`
	CreatedAt        int64    `json:"createdAt"`
}

Jump to

Keyboard shortcuts

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