search

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HighlightAll added in v0.2.4

func HighlightAll(locations bs.TermLocationMap, text string, render HighlightMatchFn) string

Types

type BleveSearchProvider

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

func NewBleveSearchProvider

func NewBleveSearchProvider(ctx context.Context, conf *config.AppConfig) BleveSearchProvider

func (BleveSearchProvider) SearchBleve

func (p BleveSearchProvider) SearchBleve(query string, fields ...string) (*bleve.SearchResult, error)

Search the Bleve index. Fields array can be used to specify which fields for which to return the full text value. pass []string{"*"] for all fields. defaults to empty. Any matched fields will be at least partially included via the fragments struct

func (BleveSearchProvider) SearchBleveRequest added in v0.3.1

func (p BleveSearchProvider) SearchBleveRequest(searchRequest *bleve.SearchRequest) (*bleve.SearchResult, error)

func (BleveSearchProvider) SearchUrls

func (p BleveSearchProvider) SearchUrls(query string) (*SearchResult, error)

type DataProvider

type DataProvider interface {
	SearchProvider
	RecentUrls(limit uint) (*SearchResult, error)
}

type HighlightMatchFn added in v0.2.4

type HighlightMatchFn func(match string) string

type SearchProvider

type SearchProvider interface {
	SearchUrls(query string) (*SearchResult, error)
}

type SearchResult added in v0.3.0

type SearchResult struct {
	Urls  []types.SearchableEntity
	Count uint
	Meta  *bleve.SearchResult
}

type SqlSearchProvider

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

func NewSqlSearchProvider

func NewSqlSearchProvider(ctx context.Context, conf *config.AppConfig) SqlSearchProvider

func (SqlSearchProvider) RecentUrls

func (p SqlSearchProvider) RecentUrls(limit uint) (*SearchResult, error)

func (SqlSearchProvider) SearchUrls

func (p SqlSearchProvider) SearchUrls(query string) (*SearchResult, error)

type URLQueryResult

type URLQueryResult struct {
	Urls  []types.UrlDbEntity
	Count uint
	Meta  *bleve.SearchResult
}

Jump to

Keyboard shortcuts

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