elasticsearch

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 15 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 Config added in v0.18.0

type Config struct {
	ElasticHost  string
	MaxConns     int
	RetrySeconds int
	BulkMaxDocs  int
	BulkMaxDelay int
	EntriesLimit int
	AgeLimit     int
	IndicesLimit int
}

Config describes configuration for elasticsearch

func NewConfig added in v0.18.0

func NewConfig(name ...string) Config

type ElasticIndex added in v0.18.0

type ElasticIndex struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ElasticIndex describes an ElasticSearch index and its current status

type ElasticSearchClient added in v0.9.0

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

ElasticSearchClient describes a ElasticSearch client connection

func NewElasticSearchClient added in v0.9.0

func NewElasticSearchClient(name string, mappings Mappings, cfg Config) (*ElasticSearchClient, error)

NewElasticSearchClient creates a new ElasticSearch client based on configuration

func (*ElasticSearchClient) BulkDelete added in v0.16.0

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

BulkDelete an object with the indexer

func (*ElasticSearchClient) BulkIndex added in v0.16.0

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

BulkIndex returns the bulk index from the indexer

func (*ElasticSearchClient) BulkIndexChild added in v0.16.0

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

BulkIndexChild index a while object with the indexer

func (*ElasticSearchClient) BulkUpdate added in v0.16.0

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

BulkUpdate and object with the indexer

func (*ElasticSearchClient) BulkUpdateWithPartialDoc added in v0.16.0

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

BulkUpdateWithPartialDoc an object with partial data using the indexer

func (*ElasticSearchClient) Delete added in v0.9.0

Delete an object

func (*ElasticSearchClient) FormatFilter added in v0.16.0

func (c *ElasticSearchClient) FormatFilter(filter *filters.Filter, mapKey string) elastic.Query

FormatFilter creates a ElasticSearch request based on filters

func (*ElasticSearchClient) Get added in v0.9.0

Get an object

func (*ElasticSearchClient) GetClient added in v0.18.0

func (c *ElasticSearchClient) GetClient() *elastic.Client

GetClient returns the elastic client object

func (*ElasticSearchClient) GetIndexAlias added in v0.18.0

func (c *ElasticSearchClient) GetIndexAlias() string

Get the rolling alias which points to the currently active index

func (*ElasticSearchClient) GetIndexAllAlias added in v0.18.0

func (c *ElasticSearchClient) GetIndexAllAlias() string

Get the alias which points to all Skydive indices

func (*ElasticSearchClient) Index added in v0.9.0

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

Index returns the skydive index

func (*ElasticSearchClient) IndexChild added in v0.9.0

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

IndexChild index a child object

func (*ElasticSearchClient) IndexPath added in v0.18.0

func (c *ElasticSearchClient) IndexPath() string

func (*ElasticSearchClient) RollIndex added in v0.18.0

func (c *ElasticSearchClient) RollIndex() error

Roll the current elasticsearch index

func (*ElasticSearchClient) Search added in v0.9.0

func (c *ElasticSearchClient) Search(obj string, query elastic.Query, index string, opts filters.SearchQuery) (*elastic.SearchResult, error)

Search an object

func (*ElasticSearchClient) ShouldRollIndex added in v0.18.0

func (c *ElasticSearchClient) ShouldRollIndex() bool

func (*ElasticSearchClient) Start added in v0.9.0

func (c *ElasticSearchClient) Start()

Start the Elasticsearch client background jobs

func (*ElasticSearchClient) Started added in v0.9.0

func (c *ElasticSearchClient) Started() bool

Started is the client already started ?

func (*ElasticSearchClient) Stop added in v0.9.0

func (c *ElasticSearchClient) Stop()

Stop Elasticsearch background client

func (*ElasticSearchClient) Update added in v0.9.0

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

Update an object

func (*ElasticSearchClient) UpdateWithPartialDoc added in v0.9.0

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

UpdateWithPartialDoc an object with partial data

type ElasticSearchClientInterface added in v0.16.0

type ElasticSearchClientInterface interface {
	FormatFilter(filter *filters.Filter, mapKey string) elastic.Query
	RollIndex() error
	Index(obj string, id string, data interface{}) (bool, error)
	BulkIndex(obj string, id string, data interface{}) (bool, error)
	IndexChild(obj string, parent string, id string, data interface{}) (bool, error)
	BulkIndexChild(obj string, parent string, id string, data interface{}) (bool, 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) (*elastic.GetResult, error)
	Delete(obj string, id string) (*elastic.DeleteResponse, error)
	BulkDelete(obj string, id string)
	Search(obj string, query elastic.Query, index string, pagination filters.SearchQuery) (*elastic.SearchResult, error)
	Start()
	GetIndexAlias() string
	GetIndexAllAlias() string
}

ElasticSearchClientInterface describes the mechanism API of ElasticSearch database client

type Mappings added in v0.18.0

type Mappings []map[string][]byte

Mappings describes the mappings of the clinet connection

Source Files

  • client.go

Jump to

Keyboard shortcuts

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