Documentation ¶
Index ¶
- func InitClients()
- type Client
- func (t *Client) AggregateBySource(ctx context.Context, model elasticsearch.AggregateModel, result ...interface{}) (err error)
- func (t *Client) BatchInsert(ctx context.Context, esIndexName string, ids []string, items []interface{}) (err error)
- func (t *Client) CreateIndexByMapping(ctx context.Context, esIndexName, esMapping string) (err error)
- func (t *Client) CreateIndexByModel(ctx context.Context, esIndexName string, model *MappingModel) (err error)
- func (t *Client) DeleteById(ctx context.Context, esIndexName, id string) (err error)
- func (t *Client) FindByModel(ctx context.Context, model elasticsearch.QueryModel) error
- func (t *Client) FindBySource(ctx context.Context, model elasticsearch.SourceModel) error
- func (t *Client) Insert(ctx context.Context, esIndexName, id string, data interface{}) (err error)
- func (t *Client) UpdateById(ctx context.Context, esIndexName, id string, updateM map[string]interface{}) (err error)
- type Mapping
- type MappingModel
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 (*Client) AggregateBySource ¶
func (t *Client) AggregateBySource(ctx context.Context, model elasticsearch.AggregateModel, result ...interface{}) (err error)
func (*Client) BatchInsert ¶
func (*Client) CreateIndexByMapping ¶
func (*Client) CreateIndexByModel ¶
func (*Client) DeleteById ¶
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
type Mapping ¶
type Mapping struct { Dynamic bool `json:"dynamic"` // false Properties map[string]*elasticsearch.MappingProperty `json:"properties"` }
type MappingModel ¶
type MappingModel struct { Mapping `json:"mappings"` Settings elasticsearch.MappingSettings `json:"settings"` }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Click to show internal directories.
Click to hide internal directories.