search

package
v0.0.0-...-88a287f Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LyricsBody

type LyricsBody struct {
	Title   string `json:"title"`
	Content string `json:"content"`
}

LyricsBody lyrics inserted body

type Service

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

Service a service to create lyrics documents and search across all lyrics

func New

func New(ctx context.Context, config *config.Config, client *elastic.Client, logger *zap.Logger) (*Service, error)

New to create instance of search service

func (*Service) Create

func (s *Service) Create(ctx context.Context, title string, content string) error

Create Create ES Document.

func (*Service) GetItemID

func (s *Service) GetItemID(ctx context.Context, title string) (id string, err error)

GetItemID Get Item ID

func (*Service) Search

func (s *Service) Search(ctx context.Context, text string) (lyrics []LyricsBody, err error)

Search to search for song lyrics across ES Index.

func (*Service) Update

func (s *Service) Update(ctx context.Context, id string, title string, content string) (err error)

Update ES Document.

Jump to

Keyboard shortcuts

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