es6

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitClients

func InitClients()

Types

type Client

type Client struct {
	*elastic.Client
}

func GetEsClient

func GetEsClient(key string) *Client

func (*Client) AggregateBySource

func (t *Client) AggregateBySource(ctx context.Context, model elasticsearch.AggregateModel, result ...interface{}) (err error)

func (*Client) BatchInsert

func (t *Client) BatchInsert(ctx context.Context, esIndexName, esTypeName string, ids []string, items []interface{}) (err error)

func (*Client) CreateIndexByMapping

func (t *Client) CreateIndexByMapping(ctx context.Context, esIndexName, esMapping string) (err error)

func (*Client) CreateIndexByModel

func (t *Client) CreateIndexByModel(ctx context.Context, esIndexName string, model *MappingModel) (err error)

func (*Client) DeleteById

func (t *Client) DeleteById(ctx context.Context, esIndexName, esTypeName, id string) (err error)

func (*Client) FindByModel

func (t *Client) FindByModel(ctx context.Context, model elasticsearch.QueryModel) error

func (*Client) FindBySource

func (t *Client) FindBySource(ctx context.Context, model elasticsearch.SourceModel) error

func (*Client) Insert

func (t *Client) Insert(ctx context.Context, esIndexName, esTypeName, id string, data interface{}) (err error)

func (*Client) UpdateById

func (t *Client) UpdateById(ctx context.Context, esIndexName, esTypeName, id string, updateM map[string]interface{}) (err error)

type Mapping

type Mapping struct {
	Dynamic    bool                                      `json:"dynamic"` // false
	Properties map[string]*elasticsearch.MappingProperty `json:"properties"`
}

type MappingModel

type MappingModel struct {
	Mappings map[string]Mapping            `json:"mappings"`
	Settings elasticsearch.MappingSettings `json:"settings"`
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Jump to

Keyboard shortcuts

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