Documentation
¶
Index ¶
- func Decode(input map[string]interface{}, result interface{}) error
- func ExtractProductQuerySuggestions(res typesense.ResultOrError, q string) []string
- func InitCollections(ctx context.Context, c *typesense.Client) error
- func NewClient(_ context.Context, cfg config.TypesenseConfig) (*typesense.Client, error)
- type ProductDocument
- type Searcher
- func (ts Searcher) IndexCategory(ctx context.Context, c anor.Category) error
- func (ts Searcher) IndexProduct(ctx context.Context, p anor.Product) error
- func (ts Searcher) IndexStore(ctx context.Context, ss anor.Store) error
- func (ts Searcher) SearchProducts(ctx context.Context, q string, p search.ProductsParams) (search.ProductResults, int64, error)
- func (ts Searcher) SearchQuerySuggestions(ctx context.Context, q string) (search.QuerySuggestionResults, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractProductQuerySuggestions ¶
func ExtractProductQuerySuggestions(res typesense.ResultOrError, q string) []string
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 (Searcher) IndexCategory ¶
func (Searcher) IndexProduct ¶
func (Searcher) IndexStore ¶
func (Searcher) SearchProducts ¶
func (ts Searcher) SearchProducts(ctx context.Context, q string, p search.ProductsParams) (search.ProductResults, int64, error)
func (Searcher) SearchQuerySuggestions ¶
Click to show internal directories.
Click to hide internal directories.