matchers

package
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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	// New creates a new query matcher.
	New(doc interface{}) (Matcher, error)

	// Map maps a document for the matcher.
	Map(doc interface{}) (interface{}, error)
}

Factory represents a matcher factory

func NewIndexMatcherFactory

func NewIndexMatcherFactory(m mapping.IndexMapping) Factory

NewIndexMatcherFactory creates a new IndexMatcherFactory.

func NewParallelMatcherFactory

func NewParallelMatcherFactory(factory Factory, threads int) Factory

NewParallelMatcherFactory creates a new ParallelMatcherFactory.

type IndexMatcher

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

IndexMatcher represents a bleve index matcher.

func (*IndexMatcher) Finish

func (m *IndexMatcher) Finish() (ids []string, errs []error)

Finish closes the matcher and returns the match results.

func (*IndexMatcher) Match

func (m *IndexMatcher) Match(id string, q query.Query)

Match matches a query with the matcher.

type IndexMatcherFactory

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

IndexMatcherFactory represents a factory for IndexMatcher.

func (IndexMatcherFactory) Map

func (f IndexMatcherFactory) Map(doc interface{}) (interface{}, error)

Map maps a document for the matcher.

func (IndexMatcherFactory) New

func (f IndexMatcherFactory) New(doc interface{}) (Matcher, error)

New creates a new query matcher.

type Matcher

type Matcher interface {
	// Match matches a query with the matcher.
	Match(id string, q query.Query)

	// Finish closes the matcher and returns the match results.
	Finish() (ids []string, errs []error)
}

Matcher represents a query matcher

type ParallelMatcher

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

ParallelMatcher represents a threaded matcher.

func (*ParallelMatcher) Finish

func (m *ParallelMatcher) Finish() (ids []string, errs []error)

Finish closes the matcher and returns the match results.

func (*ParallelMatcher) Match

func (m *ParallelMatcher) Match(id string, q query.Query)

Match matches a query with the matcher.

type ParallelMatcherFactory

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

ParallelMatcherFactory represents a factory for ParallelMatcher.

func (ParallelMatcherFactory) Map

func (f ParallelMatcherFactory) Map(doc interface{}) (interface{}, error)

Map maps a document for the matcher.

func (ParallelMatcherFactory) New

func (f ParallelMatcherFactory) New(doc interface{}) (Matcher, error)

New creates a new query matcher.

Jump to

Keyboard shortcuts

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