search

package
v0.0.0-...-48667a1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppID  string
	APIKey string
}

Config contains configuration options for the service

type Service

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

Service is the type for the service itself

func New

func New(queries *sqlc.Queries, config Config) *Service

New creates a new instance of the search service

func (*Service) DeleteModel

func (service *Service) DeleteModel(_ context.Context, collection string, key string) error

DeleteModel from index by collection and id

func (*Service) IndexModel

func (service *Service) IndexModel(ctx context.Context, collection string, key string) (err error)

IndexModel by collection and id

func (*Service) Reindex

func (service *Service) Reindex(ctx context.Context) error

Reindex every supported collection

func (*Service) Search

func (service *Service) Search(ctx *gin.Context, query common.SearchQuery, userToken string) (searchResult common.SearchResult, err error)

Search sends a search query to the engine and returns related results

Jump to

Keyboard shortcuts

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