search

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONEscape

func JSONEscape(i string) string

func Round

func Round(x, unit float64) float64

Types

type Engine

type Engine struct {
	Index bleve.Index
	Count uint64
}

Engine implements our local search engine interface.

func LoadEngine

func LoadEngine(name string) (*Engine, error)

LoadEngine loads an engine from disk.

func NewEngine

func NewEngine(name string, keys map[string]string) (*Engine, error)

NewEngine creates a new search engine with the given name.

func NewEngineFromData

func NewEngineFromData(name string, data data.Set) (*Engine, error)

NewEngineFromData creates a new search engine with the given name and data.

func (*Engine) BulkLoad

func (e *Engine) BulkLoad(src []data.Source) error

BulkLoad performs batch indexing.

func (*Engine) Search

Search the index for the given query.

type Match

type Match struct {
	ID        string
	Locations search.FieldTermLocationMap
	Score     string
	Tokens    string
	Fragments []string
}

Match represents an individual search match.

It consists of an ID (row number, file path, etc.) and, optionally, the in-text context.

type Result

type Result struct {
	Fragments search.FieldFragmentMap
	URL       string
	ID        string
}

Result is the product of performing a query.

Jump to

Keyboard shortcuts

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