bleve

package
v0.0.0-...-d2401b3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NgramFilterMin = 2
	NgramFilterMax = 3
)
View Source
const MaxQuerySize = 512

Variables

View Source
var (
	DefaultLimit  = 20
	DefaultOffset = 0
)

Functions

func AsIntOrDefault

func AsIntOrDefault(s string, def int) int

func CutoffAtRune

func CutoffAtRune(s string) string

func DebugFilter

func DebugFilter(prefix string) analysis.TokenFilter

func DeleteHandler

func DeleteHandler(idx *indexWrap) http.HandlerFunc

func ExactAnalyzerConstructor

func ExactAnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.Analyzer, error)

func Execute

func Execute(ctx context.Context, cfg config.Config) error

func ExtendedSearchHandler

func ExtendedSearchHandler(idx *indexWrap) http.HandlerFunc

func IndexStatsHandler

func IndexStatsHandler(idx *indexWrap) http.HandlerFunc

func IsASCII

func IsASCII(input []byte) bool

IsASCII checks if the input only contains ascii

func IsNotSpace

func IsNotSpace(r rune) bool

func NewFieldSort

func NewFieldSort(field string, desc bool) search.SearchSort

func NewIndex

func NewIndex(indexPath string) (*indexWrap, error)

func NewSearchRequest

func NewSearchRequest(query *RadioQuery, limit, offset int) *bleve.SearchRequest

func NewServer

func NewServer(ctx context.Context, idx *indexWrap) (*http.Server, error)

func NgramFilter

func NgramFilter(min, max int) analysis.TokenFilter

func Open

func RadioAnalyzerConstructor

func RadioAnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.Analyzer, error)

func RomajiFilter

func RomajiFilter(input analysis.TokenStream) analysis.TokenStream

func SearchHandler

func SearchHandler(idx *indexWrap) http.HandlerFunc

func SearchJSONHandler

func SearchJSONHandler(idx *indexWrap) http.HandlerFunc

func SortAnalyzerConstructor

func SortAnalyzerConstructor(config map[string]any, cache *registry.Cache) (analysis.Analyzer, error)

func UpdateHandler

func UpdateHandler(idx *indexWrap) http.HandlerFunc

Types

type Client

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

func NewClient

func NewClient(uri *url.URL) *Client

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, tids ...radio.TrackID) error

func (*Client) Search

func (c *Client) Search(ctx context.Context, query string, opt radio.SearchOptions) (radio.SearchResult, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, songs ...radio.Song) error

type FilterFn

type FilterFn func(input analysis.TokenStream) analysis.TokenStream

func (FilterFn) Filter

type KagomeTokenizer

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

func NewKagomeTokenizer

func NewKagomeTokenizer(tokeniz analysis.Tokenizer) *KagomeTokenizer

func (*KagomeTokenizer) Tokenize

func (t *KagomeTokenizer) Tokenize(input []byte) analysis.TokenStream

type RadioQuery

type RadioQuery struct {
	RawQuery     string            `json:"raw_query"`
	Query        string            `json:"query"`
	FieldQueries map[string]string `json:"field_queries"`
	Sort         search.SortOrder  `json:"sort"`
	ExactOnly    bool              `json:"exact_only"`
}

func NewQuery

func NewQuery(ctx context.Context, query string, exactOnly bool) (*RadioQuery, error)

func (*RadioQuery) Searcher

type SearchError

type SearchError struct {
	Err string
}

func (*SearchError) Error

func (se *SearchError) Error() string

Jump to

Keyboard shortcuts

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