typesense

package
v0.0.0-...-3bb7120 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(input map[string]interface{}, result interface{}) error

func ExtractProductQuerySuggestions

func ExtractProductQuerySuggestions(res typesense.ResultOrError, q string) []string

func InitCollections

func InitCollections(ctx context.Context, c *typesense.Client) error

Types

type ProductDocument

type ProductDocument struct {
	ID              int64           `mapstructure:"id"`
	CategoryID      int32           `mapstructure:"category_id"`
	Name            string          `mapstructure:"name"`
	Brand           string          `mapstructure:"brand"`
	Handle          string          `mapstructure:"handle"`
	ImageUrls       map[int]string  `mapstructure:"image_urls"`
	BasePrice       decimal.Decimal `mapstructure:"base_price"`
	Discount        decimal.Decimal `mapstructure:"discount"`
	DiscountedPrice decimal.Decimal `mapstructure:"discounted_price"`
	Rating          float32         `mapstructure:"rating"`
	NumReviews      int             `mapstructure:"num_reviews"`
	CreatedAt       time.Time       `mapstructure:"created_at"`
	UpdatedAt       time.Time       `mapstructure:"updated_at"`
}

type Searcher

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

func NewSearcher

func NewSearcher(client *typesense.Client) *Searcher

func (Searcher) IndexCategory

func (ts Searcher) IndexCategory(ctx context.Context, c anor.Category) error

func (Searcher) IndexProduct

func (ts Searcher) IndexProduct(ctx context.Context, p anor.Product) error

func (Searcher) IndexStore

func (ts Searcher) IndexStore(ctx context.Context, ss anor.Store) error

func (Searcher) SearchProducts

func (Searcher) SearchQuerySuggestions

func (ts Searcher) SearchQuerySuggestions(ctx context.Context, q string) (search.QuerySuggestionResults, error)

Jump to

Keyboard shortcuts

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