isenzo

package module
v0.0.0-...-dd08211 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2017 License: MIT Imports: 7 Imported by: 0

README

Logo

Build Status Coverage Status GitHub license

A bleve based Percolator.

Traditionally search engines search many documents with one query. A Percolator runs many queries against one document and acts on the matched query/queries.

Note: This turns out to be a really bad idea in bleve. They seem to have attached the searchers to the Query rather then the index, like Lucene does. This creates a massive number of allocs, causing the GC to pause in a bad way.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMatcherFactory

func WithMatcherFactory(matcher matchers.Factory) optionsFunc

WithMatcherFactory sets the matcher factory on the Percolator.

func WithPresearcher

func WithPresearcher(presearcher presearchers.Presearcher) optionsFunc

WithPresearcher sets the presearcher on the Percolator.

Types

type Percolator

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

Percolator represents a percolator instance.

func NewPercolator

func NewPercolator(opts ...optionsFunc) (*Percolator, error)

NewPercolator creates a new Percolator.

func (*Percolator) Match

func (p *Percolator) Match(doc map[string]interface{}) (*Results, error)

Matches matches a document and applies the changes on the first matching Query.

func (*Percolator) Update

func (p *Percolator) Update(qrys []Query) error

Update sets the queries on the Percolator.

type Query

type Query struct {
	Id    string
	Query string
}

Query represents a percolator rule, consisting of a query and a set of changes.

func NewQuery

func NewQuery(id, query string) Query

NewQuery creates a new Query.

type Results

type Results struct {
	Ids        []string
	Errs       []error
	Took       time.Duration
	QueriesRun int
}

Results represents the results of a match.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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