index

package
v0.0.0-...-0cbbf0d Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const INDEX_BATCH_SIZE int = 1000
View Source
const SEARCH_SCORE_THRESHOLD float64 = 0.5

Variables

This section is empty.

Functions

func Path

func Path(host, port string) string

Path returns the absolute path to where indexes and state for a specific MPD server should be stored.

Types

type Index

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

func New

func New(basePath string) (*Index, error)

New opens a Bleve index and returns Index. In case an index is not found at the given path, a new one is created. In case of an error, nil is returned, and the error object set accordingly.

func (*Index) Close

func (i *Index) Close() error

Close closes a Bleve index.

func (*Index) IndexFull

func (i *Index) IndexFull(songs []*song.Song, shutdown <-chan int) error

Index the entire Songlist.

func (*Index) Query

func (i *Index) Query(request *bleve.SearchRequest) ([]int, *bleve.SearchResult, error)

Query takes a Bleve search request and returns a songlist with all matching songs.

func (*Index) SetVersion

func (i *Index) SetVersion(version int) error

SetVersion writes the MPD library version to the state file.

func (*Index) Version

func (i *Index) Version() int

Version returns the index version. It should correspond to the MPD library version.

Directories

Path Synopsis
filters
unicodestrip
Package unicodestrip provides a Bleve keyword filter which decomposes unicode strings.
Package unicodestrip provides a Bleve keyword filter which decomposes unicode strings.

Jump to

Keyboard shortcuts

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