search

package
v0.0.0-...-be2aeb8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(q, val string) int

Match returns the rank of a match between q and val. 0 means best match. -1 means no match.

Types

type Filters

type Filters struct {
	Type string
}

type Result

type Result struct {
	Node model.SearchNode
	Rank int
}

type Searchable

type Searchable interface {
	Search(ctx context.Context, q string, filter *model.SearchFilter) []*Result
}

type Searcher

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

func New

func New(s ...Searchable) *Searcher

func (*Searcher) Search

func (s *Searcher) Search(ctx context.Context, q string, filter *model.SearchFilter) []*Result

Jump to

Keyboard shortcuts

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