search

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module implements the mdk.Module interface for Search.

func NewModule

func NewModule() *Module

func (*Module) FieldResolvers

func (m *Module) FieldResolvers() map[string]any

func (*Module) ID

func (m *Module) ID() string

func (*Module) Init

func (m *Module) Init(ctx context.Context, rt mdk.Runtime) error

func (*Module) Models

func (m *Module) Models() []any

func (*Module) Mutations

func (m *Module) Mutations() map[string]any

func (*Module) Queries

func (m *Module) Queries() map[string]any

func (*Module) Routes

func (m *Module) Routes() []mdk.Route

func (*Module) SearchProducts

func (m *Module) SearchProducts(ctx context.Context, input any) (any, error)

SearchProducts simulates a semantic/vector search across the product catalog.

func (*Module) SearchProductsResolver

func (m *Module) SearchProductsResolver(ctx context.Context, query string, limit *int) ([]*product.Product, error)

func (*Module) SearchProductsStep

func (m *Module) SearchProductsStep(sCtx mdk.StepContext) mdk.StepResult

SearchProductsStep wraps SearchProducts to mdk.StepHandler.

func (*Module) SetProductModule

func (m *Module) SetProductModule(pm *product.Module)

func (*Module) Shutdown

func (m *Module) Shutdown(ctx context.Context) error

type SearchHistory

type SearchHistory struct {
	ID          string         `gorm:"primaryKey" json:"id"`
	Query       string         `gorm:"not null" json:"query"`
	ActorID     string         `gorm:"index" json:"actor_id"`
	ResultCount int            `json:"result_count"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"index" json:"-"`
}

SearchHistory tracks product searches for analytics and discovery.

Jump to

Keyboard shortcuts

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