elasticsearch

package
v0.0.0-...-5b448de Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadConfig = errors.New("elasticsearch : Config file is misconfigured, check elasticsearch key format")

ErrBadConfig error bad configuration file

Functions

This section is empty.

Types

type ElasticSearchClient

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

ElasticSearchClient describes a ElasticSearch client connection

func NewElasticSearchClient

func NewElasticSearchClient(addr string, port string, maxConns int, retrySeconds int, bulkMaxDocs int, bulkMaxDelay int) (*ElasticSearchClient, error)

NewElasticSearchClient creates a new ElasticSearch client

func NewElasticSearchClientFromConfig

func NewElasticSearchClientFromConfig() (*ElasticSearchClient, error)

NewElasticSearchClientFromConfig creates a new ElasticSearch client based on configuration

func (*ElasticSearchClient) BulkDelete

func (c *ElasticSearchClient) BulkDelete(obj string, id string)

BulkDelete an object with the indexer

func (*ElasticSearchClient) BulkIndex

func (c *ElasticSearchClient) BulkIndex(obj string, id string, data interface{}) error

BulkIndex returns the bulk index from the indexer

func (*ElasticSearchClient) BulkIndexChild

func (c *ElasticSearchClient) BulkIndexChild(obj string, parent string, id string, data interface{}) error

BulkIndexChild index a while object with the indexer

func (*ElasticSearchClient) BulkUpdate

func (c *ElasticSearchClient) BulkUpdate(obj string, id string, data interface{}) error

BulkUpdate and object with the indexer

func (*ElasticSearchClient) BulkUpdateWithPartialDoc

func (c *ElasticSearchClient) BulkUpdateWithPartialDoc(obj string, id string, data interface{}) error

BulkUpdateWithPartialDoc an object with partial data using the indexer

func (*ElasticSearchClient) Delete

Delete an object

func (*ElasticSearchClient) FormatFilter

func (c *ElasticSearchClient) FormatFilter(filter *filters.Filter, mapKey string) map[string]interface{}

FormatFilter creates a ElasticSearch request based on filters

func (*ElasticSearchClient) Get

Get an object

func (*ElasticSearchClient) Index

func (c *ElasticSearchClient) Index(obj string, id string, data interface{}) error

Index returns the skydive index

func (*ElasticSearchClient) IndexChild

func (c *ElasticSearchClient) IndexChild(obj string, parent string, id string, data interface{}) error

IndexChild index a child object

func (*ElasticSearchClient) Search

func (c *ElasticSearchClient) Search(obj string, query string) (elastigo.SearchResult, error)

Search an object

func (*ElasticSearchClient) Start

func (c *ElasticSearchClient) Start(mappings []map[string][]byte)

Start the Elasticsearch client background jobs

func (*ElasticSearchClient) Started

func (c *ElasticSearchClient) Started() bool

Started is the client already started ?

func (*ElasticSearchClient) Stop

func (c *ElasticSearchClient) Stop()

Stop Elasticsearch background client

func (*ElasticSearchClient) Update

func (c *ElasticSearchClient) Update(obj string, id string, data interface{}) error

Update an object

func (*ElasticSearchClient) UpdateWithPartialDoc

func (c *ElasticSearchClient) UpdateWithPartialDoc(obj string, id string, data interface{}) error

UpdateWithPartialDoc an object with partial data

type ElasticSearchClientInterface

type ElasticSearchClientInterface interface {
	FormatFilter(filter *filters.Filter, mapKey string) map[string]interface{}
	Index(obj string, id string, data interface{}) error
	BulkIndex(obj string, id string, data interface{}) error
	IndexChild(obj string, parent string, id string, data interface{}) error
	BulkIndexChild(obj string, parent string, id string, data interface{}) error
	Update(obj string, id string, data interface{}) error
	BulkUpdate(obj string, id string, data interface{}) error
	UpdateWithPartialDoc(obj string, id string, data interface{}) error
	BulkUpdateWithPartialDoc(obj string, id string, data interface{}) error
	Get(obj string, id string) (elastigo.BaseResponse, error)
	Delete(obj string, id string) (elastigo.BaseResponse, error)
	BulkDelete(obj string, id string)
	Search(obj string, query string) (elastigo.SearchResult, error)
	Start(mappings []map[string][]byte)
}

ElasticSearchClientInterface describes the mechanism API of ElasticSearch database client

Jump to

Keyboard shortcuts

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