bleve

package
v0.0.0-...-2172853 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	DefaultLimit  = 20
	DefaultOffset = 0
	DefaultSort   = []string{"-priority", "-_score"}
)

Functions

func AddFuzzy

func AddFuzzy(q *query.Query)

func AnalyzerConstructor

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

func AsIntOrDefault

func AsIntOrDefault(s string, def int) int

func ChangeLoneWildcardIntoMatchAll

func ChangeLoneWildcardIntoMatchAll(q *query.Query)

func CutoffAtRune

func CutoffAtRune(s string) string

func DebugFilter

func DebugFilter(prefix string) analysis.TokenFilter

func DeleteHandler

func DeleteHandler(idx *indexWrap) http.HandlerFunc

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 NewIndex

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

func NewMultiAnalyzer

func NewMultiAnalyzer(pre PrefilterFn, a ...analysis.Analyzer) analysis.Analyzer

func NewServer

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

func NgramFilter

func NgramFilter(min, max int) analysis.TokenFilter

func Open

func RemoveRegexQuery

func RemoveRegexQuery(q *query.Query)

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 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, limit int64, offset int64) (*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() *KagomeTokenizer

func (*KagomeTokenizer) Tokenize

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

type PrefilterFn

type PrefilterFn func(in []byte) (out []byte)

type RadioQuery

type RadioQuery struct {
	Query string `json:"query"`
}

func NewQuery

func NewQuery(ctx context.Context, query string) (*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