Versions in this module Expand all Collapse all v1 v1.0.2 Mar 11, 2022 v1.0.1 Mar 11, 2022 v1.0.0 Mar 7, 2022 Changes in this version + const BOOL + const DATE + const DOUBLE + const EXISTS + const FLOAT + const INTEGER + const KEYWORD + const LONG + const MATCHPHRASE + const MUST + const MUSTNOT + const PREFIX + const RANGE + const SHORT + const SHOULD + const TERMS + const TEXT + const WILDCARD + func NewMapping(mp MappingPayload) string + type Base struct + Index string + Type string + func (b *Base) GetIndex() string + func (b *Base) GetType() string + func (b *Base) SetType(s string) + type Es struct + func NewEs(esIndex, esType string, opts ...EsOption) *Es + func (e *Es) SetIndex(index string) + func (e *Es) SetType(estype string) + func (es *Es) BulkDelete(ctx context.Context, ids []string) error + func (es *Es) BulkSaveOrUpdate(ctx context.Context, docs []interface{}) error + func (es *Es) CheckTypeExists(ctx context.Context) (b bool, err error) + func (es *Es) ClearIndex(ctx context.Context) error + func (es *Es) Count(ctx context.Context, paging *Paging) (int64, error) + func (es *Es) DeleteIndex(ctx context.Context) error + func (es *Es) GetByID(ctx context.Context, id string) (map[string]interface{}, error) + func (es *Es) List(ctx context.Context, paging *Paging, ...) ([]interface{}, error) + func (es *Es) NewIndex(ctx context.Context, mapping string) (exists bool, err error) + func (es *Es) Page(ctx context.Context, paging *Paging) (PageResult, error) + func (es *Es) PutMapping(ctx context.Context, mp MappingPayload) error + func (es *Es) Random(ctx context.Context, paging *Paging) ([]map[string]interface{}, error) + func (es *Es) SaveOrUpdate(ctx context.Context, doc interface{}) (string, error) + func (es *Es) Stat(ctx context.Context, paging *Paging, aggr interface{}) (map[string]interface{}, error) + type EsOption func(*Es) + func WithClient(client *elastic.Client) EsOption + func WithLogger(logger *logrus.Logger) EsOption + func WithPassword(password string) EsOption + func WithUrls(urls []string) EsOption + func WithUsername(username string) EsOption + type Field struct + Format string + Name string + Type esFieldType + type IBase interface + GetIndex func() string + GetType func() string + SetType func(s string) + type MappingPayload struct + Fields []Field + type PageResult struct + Docs []interface{} + HasNextPage bool + Page int + PageSize int + Total int + type Paging struct + DateField string + EndDate string + Excludes []string + Includes []string + Limit int + QueryConds []QueryCond + Skip int + Sortby []Sort + StartDate string + func (p Paging) String() string + type QueryCond struct + Children []QueryCond + Pair map[string][]interface{} + QueryLogic queryLogic + QueryType queryType + type Sort struct + Ascending bool + Field string v1.0.0-beta4 Mar 7, 2022 v1.0.0-beta3 Mar 2, 2022 v1.0.0-beta2 Mar 2, 2022 v1.0.0-beta1 Feb 20, 2022 v1.0.0-beta Feb 14, 2022 v1.0.0-alpha.1 Feb 13, 2022 v1.0.0-alpha Feb 10, 2022