index

package
v0.0.0-...-1d7b8b3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serialize

func Serialize(index *Index) (*pb_almanac.BleveIndex, error)

Serialize returns a proto with the contents of the supplied index.

Types

type Index

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

Index wraps a bleve index and presents a serializable interface.

func Deserialize

func Deserialize(proto *pb_almanac.BleveIndex) (*Index, error)

Deserialize returns an instance of indexService which has loaded the supplied index proto.

func NewIndex

func NewIndex() (*Index, error)

NewIndex returns an instance of index backed by an temporary location on disk. The caller is responsible for eventually calling Close() on the returned index.

func (*Index) Close

func (i *Index) Close() error

Close releases any resources held by this instance. No other methods must be called after this.

func (*Index) Index

func (i *Index) Index(id string, data interface{}) error

Index adds the supplied data to this index.

func (*Index) Search

func (i *Index) Search(ctx context.Context, query string, num int32) ([]string, error)

Search executes a search on the index and returns the ids of the log entries which match the search.

Jump to

Keyboard shortcuts

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