search

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: BSD-3-Clause Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FullTextIndex

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

FullTextIndex indexes a given set if repository items and enables a full-text search on these items.

func (*FullTextIndex) Search

func (index *FullTextIndex) Search(keywords string, maxiumNumberOfResults int) []Result

Search scans the fulltext index for the given keywords and returns any matching search results.

type ItemSearch

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

ItemSearch creates a fulltext index for given set of repository items and provides the ability to search over this index.

func NewItemSearch

func NewItemSearch(logger logger.Logger, items []*model.Item) *ItemSearch

NewItemSearch creates a new repository item searcher.

func (*ItemSearch) Search

func (itemSearch *ItemSearch) Search(keywords string, maxiumNumberOfResults int) []Result

Search returns a set of Result models that match specified keywords.

type Result

type Result struct {
	Route route.Route

	Number     int
	Score      int64
	StoreValue string
}

Result is the model returned by the fulltext index's Search function.

Jump to

Keyboard shortcuts

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