search

package
v0.0.0-...-7c4a8a6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 18 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 interface {
	SearchItems(ctx context.Context, input *gqlmodel.SearchInput) (*Response, error)
	GetSimilarItems(ctx context.Context, input *gqlmodel.GetSimilarItemsInput, item *xspanner.Item) (*Response, error)
	GetQuerySuggestions(ctx context.Context, query string) ([]string, error)
}

func NewSearchClient

func NewSearchClient(
	itemsIndexName string,
	itemsQuerySuggestionsIndexName string,
	esClient *elastic.Client,
	dbClient db.Client,
) Client

type Facet

type Facet struct {
	Title      string
	FacetType  FacetType
	Values     []*FacetValue
	TotalCount int
}

func (*Facet) IsValid

func (f *Facet) IsValid() bool

type FacetType

type FacetType int
const (
	FacetTypeCategoryIDs FacetType = iota + 1
	FacetTypeBrandNames
	FacetTypeColors
	FacetTypeMetadata
)

type FacetValue

type FacetValue struct {
	ID    string
	Name  string
	Count int
}

type Response

type Response struct {
	Items      []*es.Item
	Facets     []*Facet
	Page       int
	TotalPage  int
	TotalCount int
}

Jump to

Keyboard shortcuts

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