factory

package
v0.0.0-...-01e6a36 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INDEX          = "index"
	VENDOR_ELASTIC = "elastic"
	VENDOR_BLEVE   = "bleve"
)

Variables

This section is empty.

Functions

func CreateElasticClient

func CreateElasticClient(url *string) (*elastic.Client, error)

Types

type BleveEngine

type BleveEngine struct {
}

func (*BleveEngine) BatchIndex

func (be *BleveEngine) BatchIndex(documents []*Document) (int64, error)

func (*BleveEngine) Delete

func (be *BleveEngine) Delete() error

func (*BleveEngine) Index

func (be *BleveEngine) Index(document *Document) (int64, error)

func (*BleveEngine) Search

func (be *BleveEngine) Search(query string) (interface{}, error)

func (*BleveEngine) SetKVStore

func (be *BleveEngine) SetKVStore(storeName string) error

type Document

type Document struct {
	Id   string
	Data []byte
}

type ElasticEngine

type ElasticEngine struct {
	Client *elastic.Client
}

func (*ElasticEngine) BatchIndex

func (es *ElasticEngine) BatchIndex(documents []*Document) (int64, error)

func (*ElasticEngine) Delete

func (es *ElasticEngine) Delete() error

func (*ElasticEngine) Index

func (es *ElasticEngine) Index(document *Document) (int64, error)

func (*ElasticEngine) Search

func (es *ElasticEngine) Search(query string) (interface{}, error)

type SearchEngine

type SearchEngine interface {
	BatchIndex(documents []*Document) (int64, error)
	Index(document *Document) (int64, error)
	Search(query string) (interface{}, error)
	Delete() error
}

func GetSearchEngine

func GetSearchEngine(url *string, vendor *string, KVStore string) (SearchEngine, error)

Jump to

Keyboard shortcuts

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