Documentation ¶
Index ¶
- Variables
- type AlgoliaConfig
- type Config
- type ElasticConfig
- type Service
- func (service *Service) DeleteModel(ctx context.Context, collection string, key string) error
- func (service *Service) IndexModel(ctx context.Context, collection string, key string) (err error)
- func (service *Service) Reindex(ctx context.Context) error
- func (service *Service) ReindexElastic(ctx context.Context) error
- func (service *Service) Search(ctx *gin.Context, query common.SearchQuery, userToken string) (searchResult common.SearchResult, err error)
- func (service *Service) SearchElastic(ctx *gin.Context, query common.SearchQuery, userToken string) (searchResult common.SearchResult, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IndexShows = elasticIndex{"bccm-shows"} IndexSeasons = elasticIndex{"bccm-seasons"} IndexEpisodes = elasticIndex{"bccm-episodes"} Indices = enum.New(IndexShows, IndexSeasons, IndexEpisodes) )
Functions ¶
This section is empty.
Types ¶
type AlgoliaConfig ¶
AlgoliaConfig contains configuration options for the service
type Config ¶
type Config struct { Algolia AlgoliaConfig Elastic ElasticConfig }
Config contains configuration options for the service
type ElasticConfig ¶
type ElasticConfig struct { CloudID string ApiKey string URL string Username string Password string }
ElasticConfig contains configuration options for the service If CloudID is defined it takes precedence above URL
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the type for the service itself
func (*Service) DeleteModel ¶
DeleteModel from index by collection and id
func (*Service) IndexModel ¶
IndexModel by collection and id
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
func (*Service) SearchElastic ¶
func (service *Service) SearchElastic(ctx *gin.Context, query common.SearchQuery, userToken string) (searchResult common.SearchResult, err error)
SearchElastic sends a search query to the engine and returns related results
Click to show internal directories.
Click to hide internal directories.